fill-and-stroke.cpp revision f38286aa7d5f6b3c0ce20fa9ebf1a4d131a2c85a
/**
* \brief Fill and Stroke dialog,
* based on sp_object_properties_dialog
*
* Authors:
* Bryce W. Harrington <bryce@bryceharrington.org>
* Gustav Broberg <broberg@kth.se>
*
* Copyright (C) 2004--2007 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "desktop-handles.h"
#include "desktop-style.h"
#include "document.h"
#include "fill-and-stroke.h"
#include "filter-chemistry.h"
#include "inkscape.h"
#include "inkscape-stock.h"
#include "selection.h"
#include "style.h"
#include "svg/css-ostringstream.h"
#include "verbs.h"
#include "dialogs/fill-style.h"
#include "dialogs/stroke-style.h"
#include <widgets/paint-selector.h>
namespace Inkscape {
namespace UI {
namespace Dialog {
{
}
{
}
_fe_vbox(false, 0),
_opacity_vbox(false, 0),
_opacity_label_box(false, 0),
_blocked(false)
{
vbox->set_spacing(0);
_notebook.append_page(_page_fill, _createPageTabLabel(_("Fill"), INKSCAPE_STOCK_PROPERTIES_FILL_PAGE));
_notebook.append_page(_page_stroke_paint, _createPageTabLabel(_("Stroke _paint"), INKSCAPE_STOCK_PROPERTIES_STROKE_PAINT_PAGE));
_notebook.append_page(_page_stroke_style, _createPageTabLabel(_("Stroke st_yle"), INKSCAPE_STOCK_PROPERTIES_STROKE_PAGE));
// Filter Effects
_fe_cb.signal_blend_blur_changed().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::FillAndStroke::_blendBlurValueChanged));
// Opacity
_opacity_hscale.set_draw_value(false);
_opacity_adjustment.signal_value_changed().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::FillAndStroke::_opacityValueChanged));
// these callbacks are only for the blur and master opacity update; the tabs above take care of themselves
g_signal_connect ( G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (on_selection_changed), this );
g_signal_connect ( G_OBJECT (INKSCAPE), "change_subselection", G_CALLBACK (on_selection_changed), this );
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 );
}
{
}
void
{
}
void
{
}
void
{
}
void
{
present();
}
void
{
present();
}
void
{
present();
}
void
{
if (_blocked)
return;
_blocked = true;
//get desktop
if (!desktop) {
return;
}
// FIXME: fix for GTK breakage, see comment in SelectedStyle::on_opacity_changed; here it results in crash 1580903
//get current selection
if (!bbox) {
return;
}
//get list of selected items
//get current document
const bool remfilter = (blendmode == "normal" && radius == 0) || (blendmode == "filter" && !filter);
//apply created filter to every selected item
if(remfilter) {
remove_filter (item, false);
}
else {
if(blendmode != "filter")
}
//request update
}
}
sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:blur", SP_VERB_DIALOG_FILL_STROKE, _("Change blur"));
// resume interruptibility
_blocked = false;
}
void
{
if (_blocked)
return;
_blocked = true;
// 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_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE,
_("Change opacity"));
// resume interruptibility
_blocked = false;
}
void
{
if (_blocked)
return;
_blocked = true;
// create temporary style
// query style from desktop into it. This returns a result flag and fills query with the style of subselection, if any, or selection
switch (result) {
case QUERY_STYLE_NOTHING:
_opacity_hbox.set_sensitive(false);
// gtk_widget_set_sensitive (opa, FALSE);
break;
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_AVERAGED: // TODO: treat this slightly differently
_opacity_hbox.set_sensitive(true);
break;
}
//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);
switch(blend_result) {
case QUERY_STYLE_NOTHING:
_fe_cb.set_sensitive(false);
break;
case QUERY_STYLE_SINGLE:
_fe_cb.set_sensitive(true);
break;
// TODO: set text
_fe_cb.set_sensitive(false);
break;
}
switch (blur_result) {
case QUERY_STYLE_NOTHING: //no blurring
_fe_cb.set_blur_sensitive(false);
break;
case QUERY_STYLE_SINGLE:
if (bbox) {
_fe_cb.set_blur_sensitive(true);
//update blur widget value
}
break;
}
}
_blocked = false;
}
{
label_image)));
return *_tab_label_box;
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :