pencil-toolbar.cpp revision 981d851779765e303cf167e86f0f17b31c85da4e
235N/A#ifdef HAVE_CONFIG_H
970N/A#include "pencil-toolbar.h"
970N/A#include "widgets/ege-adjustment-action.h"
970N/A#include "widgets/ege-select-one-action.h"
1003N/A#include "widgets/ink-action.h"
970N/A#include "preferences.h"
1252N/A#include "ui/tools-switch.h"
235N/A#include "ui/icon-names.h"
911N/A#include "ui/tools/pen-tool.h"
1252N/A#include "ui/uxmanager.h"
1252N/A#include "widgets/spinbutton-events.h"
911N/A#include <selection.h>
493N/A#include "live_effects/effect.h"
493N/A#include "live_effects/lpe-simplify.h"
235N/A#include "live_effects/lpe-powerstroke.h"
235N/A#include "live_effects/effect-enum.h"
235N/A#include "live_effects/lpeobject.h"
235N/A#include "live_effects/lpeobject-reference.h"
822N/A#include "sp-lpe-item.h"
235N/A#include "util/glib-list-iterators.h"
1124N/A/* This is used in generic functions below to share large portions of code between pen and pencil tool */
970N/A // in pen tool we have more options than in pencil tool; if one of them was chosen, we do any
947N/Astatic void sp_add_freehand_mode_toggle(GtkActionGroup* mainActions, GObject* holder, bool tool_is_pencil)
947N/A guint freehandMode = prefs->getInt(( tool_is_pencil ? "/tools/freehand/pencil/freehand-mode" : "/tools/freehand/pen/freehand-mode" ), 0);
1124N/A if (!tool_is_pencil) {
963N/A g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(freehand_mode_changed), holder);
493N/Astatic void freehand_add_advanced_shape_options(GtkActionGroup* mainActions, GObject* holder, bool tool_is_pencil)
606N/A ege_select_one_action_set_active( act1, prefs->getInt(( tool_is_pencil ? "/tools/freehand/pencil/shape" : "/tools/freehand/pen/shape" ), 0) );
235N/Avoid sp_pen_toolbox_prep(SPDesktop * /*desktop*/, GtkActionGroup* mainActions, GObject* holder)
Inkscape::LivePathEffect::Effect* simplify = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY);
if(simplify){
Inkscape::LivePathEffect::LPESimplify *lpe_simplify = dynamic_cast<Inkscape::LivePathEffect::LPESimplify*>(simplify->getLPEObj()->get_lpe());
if (lpe_simplify) {
Inkscape::LivePathEffect::Effect* powerstroke = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::POWERSTROKE);
bool simplified = false;
if(powerstroke){
Inkscape::LivePathEffect::LPEPowerStroke *lpe_powerstroke = dynamic_cast<Inkscape::LivePathEffect::LPEPowerStroke*>(powerstroke->getLPEObj()->get_lpe());
if(lpe_powerstroke){
if (sp_shape) {
simplified = true;
if(!simplified){
gchar const* labels[] = {_("(many nodes, rough)"), _("(default)"), 0, 0, 0, 0, _("(few nodes, smooth)")};
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getInt("/tools/freehand/pencil/simplify", 0) );