index 4f32d3d91df7be99afff404d479597fffba13737..ab25f5bb3da0d5055a9d7795989fa78e66a5d8b7 100644 (file)
g_signal_connect ( G_OBJECT (INKSCAPE), "modify_selection", G_CALLBACK (on_selection_modified), this );
g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (on_selection_changed), this );
- selectionChanged(INKSCAPE, sp_desktop_selection(SP_ACTIVE_DESKTOP));
+ selectionChanged(INKSCAPE, sp_desktop_selection(getDesktop()));
show_all_children();
}
_blocked = true;
//get desktop
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPDesktop *desktop = getDesktop();
if (!desktop) {
return;
}
}
}
- sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:blur", SP_VERB_DIALOG_FILL_STROKE, _("Change blur"));
+ sp_document_maybe_done (sp_desktop_document (desktop), "fillstroke:blur", SP_VERB_DIALOG_FILL_STROKE, _("Change blur"));
// resume interruptibility
sp_canvas_end_forced_full_redraws(sp_desktop_canvas(desktop));
return;
_blocked = true;
+ SPDesktop *desktop = getDesktop();
+
// 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(SP_ACTIVE_DESKTOP), 0);
+ sp_canvas_force_full_redraw_after_interruptions(sp_desktop_canvas(desktop), 0);
SPCSSAttr *css = sp_repr_css_attr_new ();
os << CLAMP (_opacity_adjustment.get_value() / 100, 0.0, 1.0);
sp_repr_css_set_property (css, "opacity", os.str().c_str());
- sp_desktop_set_style (SP_ACTIVE_DESKTOP, css);
+ sp_desktop_set_style (desktop, css);
sp_repr_css_attr_unref (css);
- sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE,
+ sp_document_maybe_done (sp_desktop_document (desktop), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE,
_("Change opacity"));
// resume interruptibility
- sp_canvas_end_forced_full_redraws(sp_desktop_canvas(SP_ACTIVE_DESKTOP));
+ sp_canvas_end_forced_full_redraws(sp_desktop_canvas(desktop));
_blocked = false;
}
return;
_blocked = true;
+ SPDesktop *desktop = getDesktop();
+
// create temporary style
- SPStyle *query = sp_style_new (SP_ACTIVE_DOCUMENT);
+ SPStyle *query = sp_style_new (sp_desktop_document(desktop));
// query style from desktop into it. This returns a result flag and fills query with the style of subselection, if any, or selection
- int result = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
+ int result = sp_desktop_query_style (desktop, query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
switch (result) {
case QUERY_STYLE_NOTHING:
}
//query now for current filter mode and average blurring of selection
- const int blend_result = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_BLEND);
+ const int blend_result = sp_desktop_query_style (desktop, query, QUERY_STYLE_PROPERTY_BLEND);
switch(blend_result) {
case QUERY_STYLE_NOTHING:
_fe_cb.set_sensitive(false);
}
if(blend_result == QUERY_STYLE_SINGLE || blend_result == QUERY_STYLE_MULTIPLE_SAME) {
- int blur_result = sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_BLUR);
+ int blur_result = sp_desktop_query_style (desktop, query, QUERY_STYLE_PROPERTY_BLUR);
switch (blur_result) {
case QUERY_STYLE_NOTHING: //no blurring
_fe_cb.set_blur_sensitive(false);
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_AVERAGED:
case QUERY_STYLE_MULTIPLE_SAME:
- NR::Maybe<NR::Rect> bbox = sp_desktop_selection(SP_ACTIVE_DESKTOP)->bounds();
+ NR::Maybe<NR::Rect> bbox = sp_desktop_selection(desktop)->bounds();
if (bbox) {
double perimeter = bbox->extent(NR::X) + bbox->extent(NR::Y);
_fe_cb.set_blur_sensitive(true);