summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/object-composite-settings.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-18 18:13:01 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-18 18:13:01 +0000
commit0d3d7f676b29f9d9a9cd53f08ced76e6588b856a (patch)
tree12a2646048750e49e7edee42046b8aa138207f2c /src/ui/widget/object-composite-settings.cpp
parentwarping into a layer (diff)
parentReplace sp_style_xxx functions with SPStyle member functions. (diff)
downloadinkscape-0d3d7f676b29f9d9a9cd53f08ced76e6588b856a.tar.gz
inkscape-0d3d7f676b29f9d9a9cd53f08ced76e6588b856a.zip
update to trunk
(bzr r13682.1.22)
Diffstat (limited to 'src/ui/widget/object-composite-settings.cpp')
-rw-r--r--src/ui/widget/object-composite-settings.cpp51
1 files changed, 14 insertions, 37 deletions
diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp
index e4cd76345..00a74c4fe 100644
--- a/src/ui/widget/object-composite-settings.cpp
+++ b/src/ui/widget/object-composite-settings.cpp
@@ -17,7 +17,7 @@
#include <glibmm/i18n.h>
#include "desktop.h"
-#include "desktop-handles.h"
+
#include "desktop-style.h"
#include "document.h"
#include "document-undo.h"
@@ -39,26 +39,6 @@ namespace Inkscape {
namespace UI {
namespace Widget {
-/*void ObjectCompositeSettings::_on_desktop_activate(
- InkscapeApplication *application,
- SPDesktop *desktop,
- ObjectCompositeSettings *w
-) {
- if (w->_subject) {
- w->_subject->setDesktop(desktop);
- }
-}
-
-void ObjectCompositeSettings::_on_desktop_deactivate(
- InkscapeApplication *application,
- SPDesktop *desktop,
- ObjectCompositeSettings *w
-) {
- if (w->_subject) {
- w->_subject->setDesktop(NULL);
- }
-}*/
-
ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char const *history_prefix, int flags)
: _verb_code(verb_code),
_blur_tag(Glib::ustring(history_prefix) + ":blur"),
@@ -102,7 +82,6 @@ ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char co
ObjectCompositeSettings::~ObjectCompositeSettings() {
setSubject(NULL);
- g_signal_handler_disconnect(G_OBJECT(INKSCAPE), _desktop_activated);
}
void ObjectCompositeSettings::setSubject(StyleSubject *subject) {
@@ -125,14 +104,14 @@ ObjectCompositeSettings::_blendBlurValueChanged()
if (!desktop) {
return;
}
- SPDocument *document = sp_desktop_document (desktop);
+ SPDocument *document = desktop->getDocument();
if (_blocked)
return;
_blocked = true;
// FIXME: fix for GTK breakage, see comment in SelectedStyle::on_opacity_changed; here it results in crash 1580903
- //sp_canvas_force_full_redraw_after_interruptions(sp_desktop_canvas(desktop), 0);
+ //sp_canvas_force_full_redraw_after_interruptions(desktop->getCanvas(), 0);
Geom::OptRect bbox = _subject->getBounds(SPItem::GEOMETRIC_BBOX);
double radius;
@@ -180,7 +159,7 @@ ObjectCompositeSettings::_blendBlurValueChanged()
_("Change blur"));
// resume interruptibility
- //sp_canvas_end_forced_full_redraws(sp_desktop_canvas(desktop));
+ //sp_canvas_end_forced_full_redraws(desktop->getCanvas());
_blocked = false;
}
@@ -204,7 +183,7 @@ ObjectCompositeSettings::_opacityValueChanged()
// FIXME: fix for GTK breakage, see comment in SelectedStyle::on_opacity_changed; here it results in crash 1580903
// UPDATE: crash fixed in GTK+ 2.10.7 (bug 374378), remove this as soon as it's reasonably common
// (though this only fixes the crash, not the multiple change events)
- //sp_canvas_force_full_redraw_after_interruptions(sp_desktop_canvas(desktop), 0);
+ //sp_canvas_force_full_redraw_after_interruptions(desktop->getCanvas(), 0);
SPCSSAttr *css = sp_repr_css_attr_new ();
@@ -216,11 +195,11 @@ ObjectCompositeSettings::_opacityValueChanged()
sp_repr_css_attr_unref (css);
- DocumentUndo::maybeDone(sp_desktop_document (desktop), _opacity_tag.c_str(), _verb_code,
+ DocumentUndo::maybeDone(desktop->getDocument(), _opacity_tag.c_str(), _verb_code,
_("Change opacity"));
// resume interruptibility
- //sp_canvas_end_forced_full_redraws(sp_desktop_canvas(desktop));
+ //sp_canvas_end_forced_full_redraws(desktop->getCanvas());
_blocked = false;
}
@@ -240,8 +219,8 @@ ObjectCompositeSettings::_subjectChanged() {
return;
_blocked = true;
- SPStyle *query = sp_style_new (sp_desktop_document(desktop));
- 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:
@@ -252,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:
@@ -274,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);
@@ -287,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);
}
@@ -295,8 +274,6 @@ ObjectCompositeSettings::_subjectChanged() {
}
}
- sp_style_unref(query);
-
_blocked = false;
}