summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-12-25 19:30:29 +0000
committertavmjong-free <tavmjong@free.fr>2014-12-25 19:30:29 +0000
commit05f2f043bdbadefa4ea435981e1a728420d6b93c (patch)
tree134097c69539d87e64940ab1a86642daac555281 /src/ui/widget
parentRemove sp_style_merge_from_parent() and sp_style_merge_from_dying_parent(). (diff)
downloadinkscape-05f2f043bdbadefa4ea435981e1a728420d6b93c.tar.gz
inkscape-05f2f043bdbadefa4ea435981e1a728420d6b93c.zip
Remove sp_style_new().
(bzr r13822.1.6)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/object-composite-settings.cpp16
-rw-r--r--src/ui/widget/selected-style.cpp26
2 files changed, 19 insertions, 23 deletions
diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp
index 7439a402c..00a74c4fe 100644
--- a/src/ui/widget/object-composite-settings.cpp
+++ b/src/ui/widget/object-composite-settings.cpp
@@ -219,8 +219,8 @@ ObjectCompositeSettings::_subjectChanged() {
return;
_blocked = true;
- SPStyle *query = sp_style_new (desktop->getDocument());
- int result = _subject->queryStyle(query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
+ SPStyle query(desktop->getDocument());
+ int result = _subject->queryStyle(&query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
switch (result) {
case QUERY_STYLE_NOTHING:
@@ -231,19 +231,19 @@ ObjectCompositeSettings::_subjectChanged() {
case QUERY_STYLE_MULTIPLE_AVERAGED: // TODO: treat this slightly differently
case QUERY_STYLE_MULTIPLE_SAME:
_opacity_vbox.set_sensitive(true);
- _opacity_scale.get_adjustment()->set_value(100 * SP_SCALE24_TO_FLOAT(query->opacity.value));
+ _opacity_scale.get_adjustment()->set_value(100 * SP_SCALE24_TO_FLOAT(query.opacity.value));
break;
}
//query now for current filter mode and average blurring of selection
- const int blend_result = _subject->queryStyle(query, QUERY_STYLE_PROPERTY_BLEND);
+ const int blend_result = _subject->queryStyle(&query, QUERY_STYLE_PROPERTY_BLEND);
switch(blend_result) {
case QUERY_STYLE_NOTHING:
_fe_cb.set_sensitive(false);
break;
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_SAME:
- _fe_cb.set_blend_mode(query->filter_blend_mode.value);
+ _fe_cb.set_blend_mode(query.filter_blend_mode.value);
_fe_cb.set_sensitive(true);
break;
case QUERY_STYLE_MULTIPLE_DIFFERENT:
@@ -253,7 +253,7 @@ ObjectCompositeSettings::_subjectChanged() {
}
if(blend_result == QUERY_STYLE_SINGLE || blend_result == QUERY_STYLE_MULTIPLE_SAME) {
- int blur_result = _subject->queryStyle(query, QUERY_STYLE_PROPERTY_BLUR);
+ int blur_result = _subject->queryStyle(&query, QUERY_STYLE_PROPERTY_BLUR);
switch (blur_result) {
case QUERY_STYLE_NOTHING: //no blurring
_fe_cb.set_blur_sensitive(false);
@@ -266,7 +266,7 @@ ObjectCompositeSettings::_subjectChanged() {
double perimeter = bbox->dimensions()[Geom::X] + bbox->dimensions()[Geom::Y]; // fixme: this is only half the perimeter, is that correct?
_fe_cb.set_blur_sensitive(true);
//update blur widget value
- float radius = query->filter_gaussianBlur_deviation.value;
+ float radius = query.filter_gaussianBlur_deviation.value;
float percent = radius * 400 / perimeter; // so that for a square, 100% == half side
_fe_cb.set_blur_value(percent);
}
@@ -274,8 +274,6 @@ ObjectCompositeSettings::_subjectChanged() {
}
}
- sp_style_unref(query);
-
_blocked = false;
}
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 93b4893f2..1fc67dcef 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -977,7 +977,7 @@ SelectedStyle::update()
return;
// create temporary style
- SPStyle *query = sp_style_new (_desktop->getDocument());
+ SPStyle query(_desktop->getDocument());
for (int i = SS_FILL; i <= SS_STROKE; i++) {
Gtk::EventBox *place = (i == SS_FILL)? &_fill_place : &_stroke_place;
@@ -995,7 +995,7 @@ SelectedStyle::update()
_popup_copy[i].set_sensitive(false);
// query style from desktop. This returns a result flag and fills query with the style of subselection, if any, or selection
- int result = sp_desktop_query_style (_desktop, query,
+ int result = sp_desktop_query_style (_desktop, &query,
(i == SS_FILL)? QUERY_STYLE_PROPERTY_FILL : QUERY_STYLE_PROPERTY_STROKE);
switch (result) {
case QUERY_STYLE_NOTHING:
@@ -1020,12 +1020,12 @@ SelectedStyle::update()
}
SPIPaint *paint;
if (i == SS_FILL) {
- paint = &(query->fill);
+ paint = &(query.fill);
} else {
- paint = &(query->stroke);
+ paint = &(query.stroke);
}
if (paint->set && paint->isPaintserver()) {
- SPPaintServer *server = (i == SS_FILL)? SP_STYLE_FILL_SERVER (query) : SP_STYLE_STROKE_SERVER (query);
+ SPPaintServer *server = (i == SS_FILL)? SP_STYLE_FILL_SERVER (&query) : SP_STYLE_STROKE_SERVER (&query);
if ( server ) {
Inkscape::XML::Node *srepr = server->getRepr();
_paintserver_id[i] += "url(#";
@@ -1062,7 +1062,7 @@ SelectedStyle::update()
}
} 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));
+ SP_SCALE24_TO_FLOAT ((i == SS_FILL)? query.fill_opacity.value : query.stroke_opacity.value));
_lastselected[i] = _thisselected[i];
_thisselected[i] = color; // include opacity
((Inkscape::UI::Widget::ColorPreview*)_color_preview[i])->setRgba32 (color);
@@ -1105,7 +1105,7 @@ SelectedStyle::update()
clearTooltip(_opacity_place);
clearTooltip(_opacity_sb);
- int result = sp_desktop_query_style (_desktop, query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
+ int result = sp_desktop_query_style (_desktop, &query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
switch (result) {
case QUERY_STYLE_NOTHING:
@@ -1122,16 +1122,16 @@ SelectedStyle::update()
_opacity_blocked = true;
_opacity_sb.set_sensitive(true);
#if WITH_GTKMM_3_0
- _opacity_adjustment->set_value(SP_SCALE24_TO_FLOAT(query->opacity.value) * 100);
+ _opacity_adjustment->set_value(SP_SCALE24_TO_FLOAT(query.opacity.value) * 100);
#else
- _opacity_adjustment.set_value(SP_SCALE24_TO_FLOAT(query->opacity.value) * 100);
+ _opacity_adjustment.set_value(SP_SCALE24_TO_FLOAT(query.opacity.value) * 100);
#endif
_opacity_blocked = false;
break;
}
// Now query stroke_width
- int result_sw = sp_desktop_query_style (_desktop, query, QUERY_STYLE_PROPERTY_STROKEWIDTH);
+ int result_sw = sp_desktop_query_style (_desktop, &query, QUERY_STYLE_PROPERTY_STROKEWIDTH);
switch (result_sw) {
case QUERY_STYLE_NOTHING:
_stroke_width.set_markup("");
@@ -1143,9 +1143,9 @@ SelectedStyle::update()
{
double w;
if (_sw_unit) {
- w = Inkscape::Util::Quantity::convert(query->stroke_width.computed, "px", _sw_unit);
+ w = Inkscape::Util::Quantity::convert(query.stroke_width.computed, "px", _sw_unit);
} else {
- w = query->stroke_width.computed;
+ w = query.stroke_width.computed;
}
current_stroke_width = w;
@@ -1168,8 +1168,6 @@ SelectedStyle::update()
default:
break;
}
-
- sp_style_unref(query);
}
void SelectedStyle::opacity_0(void) {_opacity_sb.set_value(0);}