diff --git a/plugins/paintops/CMakeLists.txt b/plugins/paintops/CMakeLists.txt index 8fe2cc7786..57e8151a61 100644 --- a/plugins/paintops/CMakeLists.txt +++ b/plugins/paintops/CMakeLists.txt @@ -1,20 +1,19 @@ include_directories(libpaintop) add_subdirectory( libpaintop ) add_subdirectory( defaultpresets ) add_subdirectory( defaultpaintops ) add_subdirectory( hairy ) -add_subdirectory( chalk ) add_subdirectory( dynadraw ) add_subdirectory( deform ) add_subdirectory( curvebrush ) add_subdirectory( spray ) add_subdirectory( filterop ) add_subdirectory( experiment ) add_subdirectory( particle ) add_subdirectory( gridbrush ) add_subdirectory( hatching) add_subdirectory( sketch ) add_subdirectory( colorsmudge ) add_subdirectory( roundmarker ) add_subdirectory( tangentnormal ) diff --git a/plugins/paintops/chalk/CMakeLists.txt b/plugins/paintops/chalk/CMakeLists.txt deleted file mode 100644 index ba2afefcf3..0000000000 --- a/plugins/paintops/chalk/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(kritachalkpaintop_SOURCES - chalk_paintop_plugin.cpp - kis_chalk_paintop.cpp - kis_chalkop_option.cpp - kis_chalk_paintop_settings.cpp - kis_chalk_paintop_settings_widget.cpp - chalk_brush.cpp - ) - -ki18n_wrap_ui(kritachalkpaintop_SOURCES wdgchalkoptions.ui ) - -add_library(kritachalkpaintop MODULE ${kritachalkpaintop_SOURCES}) - -target_link_libraries(kritachalkpaintop kritalibpaintop) - -install(TARGETS kritachalkpaintop DESTINATION ${KRITA_PLUGIN_INSTALL_DIR}) -install( FILES - krita-chalk.png DESTINATION ${DATA_INSTALL_DIR}/krita/images) diff --git a/plugins/paintops/chalk/chalk_brush.cpp b/plugins/paintops/chalk/chalk_brush.cpp deleted file mode 100644 index e9e0420cf0..0000000000 --- a/plugins/paintops/chalk/chalk_brush.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2008-2010 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "chalk_brush.h" - -#include "kis_global.h" - -#include -#include -#include - -#include -#include - -#include "kis_random_accessor_ng.h" -#include -#include - - -ChalkBrush::ChalkBrush(const ChalkProperties* properties, KoColorTransformation* transformation) -{ - m_transfo = transformation; - if (m_transfo) { - m_transfo->setParameter(m_transfo->parameterId("h"), 0.0); - m_saturationId = m_transfo->parameterId("s"); // cache for later usage - m_transfo->setParameter(m_transfo->parameterId("v"), 0.0); - m_transfo->setParameter(3, 1);//sets the type to hsv. - m_transfo->setParameter(4, false);//sets the colorize to none. - } - else { - m_saturationId = -1; - } - - - m_counter = 0; - m_properties = properties; -} - - -ChalkBrush::~ChalkBrush() -{ - delete m_transfo; -} - - -void ChalkBrush::paint(KisPaintDeviceSP dev, qreal x, qreal y, const KoColor &color, qreal additionalScale) -{ - m_inkColor = color; - m_counter++; - - qint32 pixelSize = dev->colorSpace()->pixelSize(); - KisRandomAccessorSP accessor = dev->createRandomAccessorNG((int)x, (int)y); - - qreal result; - if (m_properties->inkDepletion) { - //count decrementing of saturation and opacity - result = log((qreal)m_counter); - result = -(result * 10) / 100.0; - - if (m_properties->useSaturation) { - if (m_transfo) { - m_transfo->setParameter(m_saturationId, 1.0f + result); - m_transfo->transform(m_inkColor.data(), m_inkColor.data(), 1); - } - - } - - if (m_properties->useOpacity) { - qreal opacity = (1.0f + result); - m_inkColor.setOpacity(opacity); - } - } - - int pixelX, pixelY; - const int radius = m_properties->radius * additionalScale; - const int radiusSquared = pow2(radius); - double dirtThreshold = 0.5; - - - for (int by = -radius; by <= radius; by++) { - int bySquared = by * by; - for (int bx = -radius; bx <= radius; bx++) { - // let's call that noise from ground to chalk :) - if (((bx * bx + bySquared) > radiusSquared) || - m_randomSource.generateNormalized() < dirtThreshold) { - continue; - } - - pixelX = qRound(x + bx); - pixelY = qRound(y + by); - - accessor->moveTo(pixelX, pixelY); - memcpy(accessor->rawData(), m_inkColor.data(), pixelSize); - } - } -} - diff --git a/plugins/paintops/chalk/chalk_brush.h b/plugins/paintops/chalk/chalk_brush.h deleted file mode 100644 index 4c5e3eec20..0000000000 --- a/plugins/paintops/chalk/chalk_brush.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2008-2010 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef CHALK_BRUSH_H_ -#define CHALK_BRUSH_H_ - -#include - -#include - -#include "kis_chalkop_option.h" -#include "kis_paint_device.h" -#include - - -class ChalkBrush -{ - -public: - ChalkBrush(const ChalkProperties * properties, KoColorTransformation* transformation); - ~ChalkBrush(); - void paint(KisPaintDeviceSP dev, qreal x, qreal y, const KoColor &color, qreal additionalScale); - -private: - KoColor m_inkColor; - int m_counter; - const ChalkProperties * m_properties; - KoColorTransformation* m_transfo; - int m_saturationId; - KisRandomSource m_randomSource; -}; - -#endif diff --git a/plugins/paintops/chalk/chalk_paintop_plugin.cpp b/plugins/paintops/chalk/chalk_paintop_plugin.cpp deleted file mode 100644 index f3948920d1..0000000000 --- a/plugins/paintops/chalk/chalk_paintop_plugin.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2008 Lukáš Tvrdý (lukast.dev@gmail.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include "chalk_paintop_plugin.h" - - -#include - -#include -#include - -#include - - -#include "kis_chalk_paintop.h" -#include "kis_simple_paintop_factory.h" - -#include "kis_global.h" - -K_PLUGIN_FACTORY_WITH_JSON(ChalkPaintOpPluginFactory, "kritachalkpaintop.json", registerPlugin();) - - -ChalkPaintOpPlugin::ChalkPaintOpPlugin(QObject *parent, const QVariantList &) - : QObject(parent) -{ - KisPaintOpRegistry *r = KisPaintOpRegistry::instance(); - r->add(new KisSimplePaintOpFactory("chalkbrush", i18n("Chalk"), KisPaintOpFactory::categoryStable(), "krita-chalk.png")); - -} - -ChalkPaintOpPlugin::~ChalkPaintOpPlugin() -{ -} - -#include "chalk_paintop_plugin.moc" diff --git a/plugins/paintops/chalk/chalk_paintop_plugin.h b/plugins/paintops/chalk/chalk_paintop_plugin.h deleted file mode 100644 index 0d78033afd..0000000000 --- a/plugins/paintops/chalk/chalk_paintop_plugin.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2008 Lukáš Tvrdý (lukast.dev@gmail.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef CHALK_PAINTOP_PLUGIN_H_ -#define CHALK_PAINTOP_PLUGIN_H_ - -#include -#include - -/** - * A plugin wrapper that adds the paintop factories to the paintop registry. - */ -class ChalkPaintOpPlugin : public QObject -{ - Q_OBJECT -public: - ChalkPaintOpPlugin(QObject *parent, const QVariantList &); - ~ChalkPaintOpPlugin() override; -}; - -#endif // CHALK_PAINTOP_PLUGIN_H_ diff --git a/plugins/paintops/chalk/kis_chalk_paintop.cpp b/plugins/paintops/chalk/kis_chalk_paintop.cpp deleted file mode 100644 index 5c8158fcf1..0000000000 --- a/plugins/paintops/chalk/kis_chalk_paintop.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2008-2010 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kis_chalk_paintop.h" -#include "kis_chalk_paintop_settings.h" - -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -KisChalkPaintOp::KisChalkPaintOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisNodeSP node, KisImageSP image) - : KisPaintOp(painter) -{ - Q_UNUSED(image); - Q_UNUSED(node); - m_airbrushOption.readOptionSetting(settings); - m_opacityOption.readOptionSetting(settings); - m_rateOption.readOptionSetting(settings); - m_opacityOption.resetAllSensors(); - m_rateOption.resetAllSensors(); - - m_properties.readOptionSetting(settings); - - KoColorTransformation* transfo = 0; - if (m_properties.inkDepletion && m_properties.useSaturation) { - transfo = painter->device()->compositionSourceColorSpace()->createColorTransformation("hsv_adjustment", QHash()); - } - m_chalkBrush = new ChalkBrush(&m_properties, transfo); -} - -KisChalkPaintOp::~KisChalkPaintOp() -{ - delete m_chalkBrush; -} - -KisSpacingInformation KisChalkPaintOp::paintAt(const KisPaintInformation& info) -{ - if (!painter()) return KisSpacingInformation(1.0); - - if (!m_dab) { - m_dab = source()->createCompositionSourceDevice(); - } - else { - m_dab->clear(); - } - - qreal x1, y1; - - x1 = info.pos().x(); - y1 = info.pos().y(); - - const qreal additionalScale = KisLodTransform::lodToScale(painter()->device()); - - quint8 origOpacity = m_opacityOption.apply(painter(), info); - m_chalkBrush->paint(m_dab, x1, y1, painter()->paintColor(), additionalScale); - - QRect rc = m_dab->extent(); - - painter()->bitBlt(rc.x(), rc.y(), m_dab, rc.x(), rc.y(), rc.width(), rc.height()); - painter()->renderMirrorMask(rc, m_dab); - painter()->setOpacity(origOpacity); - - return updateSpacingImpl(info); -} - -KisSpacingInformation KisChalkPaintOp::updateSpacingImpl(const KisPaintInformation &info) const -{ - return KisPaintOpPluginUtils::effectiveSpacing(1.0, 1.0, true, 0.0, false, 1.0, false, 1.0, 1.0, - &m_airbrushOption, nullptr, info); -} - -KisTimingInformation KisChalkPaintOp::updateTimingImpl(const KisPaintInformation &info) const -{ - return KisPaintOpPluginUtils::effectiveTiming(&m_airbrushOption, &m_rateOption, info); -} diff --git a/plugins/paintops/chalk/kis_chalk_paintop.h b/plugins/paintops/chalk/kis_chalk_paintop.h deleted file mode 100644 index 2cec5ce181..0000000000 --- a/plugins/paintops/chalk/kis_chalk_paintop.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2008 Boudewijn Rempt - * Copyright (c) 2008, 2009 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef KIS_CHALK_PAINTOP_H_ -#define KIS_CHALK_PAINTOP_H_ - -#include -#include - -#include "chalk_brush.h" -#include "kis_chalk_paintop_settings.h" -#include "kis_airbrush_option.h" -#include "kis_pressure_rate_option.h" - -class KisPainter; - -class KisChalkPaintOp : public KisPaintOp -{ - -public: - - KisChalkPaintOp(const KisPaintOpSettingsSP settings, KisPainter *painter, KisNodeSP node, KisImageSP image); - ~KisChalkPaintOp() override; - -protected: - - KisSpacingInformation paintAt(const KisPaintInformation& info) override; - - KisSpacingInformation updateSpacingImpl(const KisPaintInformation &info) const override; - - KisTimingInformation updateTimingImpl(const KisPaintInformation &info) const override; - -private: - KisPaintDeviceSP m_dab; - ChalkBrush * m_chalkBrush; - KisAirbrushOption m_airbrushOption; - KisPressureOpacityOption m_opacityOption; - KisPressureRateOption m_rateOption; - ChalkProperties m_properties; -}; - -#endif // KIS_CHALK_PAINTOP_H_ diff --git a/plugins/paintops/chalk/kis_chalk_paintop_settings.cpp b/plugins/paintops/chalk/kis_chalk_paintop_settings.cpp deleted file mode 100644 index 2409d03618..0000000000 --- a/plugins/paintops/chalk/kis_chalk_paintop_settings.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2008 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kis_chalk_paintop_settings.h" - -#include - -#include -#include - -KisChalkPaintOpSettings::KisChalkPaintOpSettings() -{ -} - -bool KisChalkPaintOpSettings::paintIncremental() -{ - return (enumPaintActionType)getInt("PaintOpAction", WASH) == BUILDUP; -} - -QPainterPath KisChalkPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode) -{ - QPainterPath path; - if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) { - qreal size = getInt(CHALK_RADIUS) * 2 + 1; - path = ellipseOutline(size, size, 1.0, 0.0); - - if (mode == CursorTiltOutline) { - path.addPath(makeTiltIndicator(info, QPointF(0.0, 0.0), size * 0.5, 3.0)); - } - - path.translate(info.pos()); - } - return path; -} - -void KisChalkPaintOpSettings::setPaintOpSize(qreal value) -{ - ChalkProperties properties; - properties.readOptionSetting(this); - properties.radius = qRound(0.5 * value); - properties.writeOptionSetting(this); -} - -qreal KisChalkPaintOpSettings::paintOpSize() const -{ - ChalkProperties properties; - properties.readOptionSetting(this); - return properties.radius * 2; -} diff --git a/plugins/paintops/chalk/kis_chalk_paintop_settings.h b/plugins/paintops/chalk/kis_chalk_paintop_settings.h deleted file mode 100644 index 3096f50727..0000000000 --- a/plugins/paintops/chalk/kis_chalk_paintop_settings.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2008,2009 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef KIS_CHALK_PAINTOP_SETTINGS_H_ -#define KIS_CHALK_PAINTOP_SETTINGS_H_ - -#include -#include - -#include "kis_chalk_paintop_settings_widget.h" - -#include - - -class KisChalkPaintOpSettings : public KisPaintOpSettings -{ - -public: - KisChalkPaintOpSettings(); - ~KisChalkPaintOpSettings() override {} - - QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override; - - void setPaintOpSize(qreal value) override; - qreal paintOpSize() const override; - - bool paintIncremental() override; -}; - -#endif diff --git a/plugins/paintops/chalk/kis_chalk_paintop_settings_widget.cpp b/plugins/paintops/chalk/kis_chalk_paintop_settings_widget.cpp deleted file mode 100644 index d57d7c8ee7..0000000000 --- a/plugins/paintops/chalk/kis_chalk_paintop_settings_widget.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2008 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kis_chalk_paintop_settings_widget.h" - -#include "kis_chalkop_option.h" -#include "kis_chalk_paintop_settings.h" - -#include -#include -#include - -#include -#include -#include - -KisChalkPaintOpSettingsWidget:: KisChalkPaintOpSettingsWidget(QWidget* parent) - : KisPaintOpSettingsWidget(parent) -{ - m_chalkOption = new KisChalkOpOption(); - addPaintOpOption(m_chalkOption, i18n("Brush size")); - addPaintOpOption(new KisCurveOptionWidget(new KisPressureOpacityOption(), i18n("Transparent"), i18n("Opaque")), i18n("Opacity")); - addPaintOpOption(new KisAirbrushOption(false), i18n("Airbrush")); - addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate")); - addPaintOpOption(new KisPaintActionTypeOption(), i18n("Painting Mode")); -} - -KisChalkPaintOpSettingsWidget::~ KisChalkPaintOpSettingsWidget() -{ -} - -KisPropertiesConfigurationSP KisChalkPaintOpSettingsWidget::configuration() const -{ - KisChalkPaintOpSettings* config = new KisChalkPaintOpSettings(); - config->setOptionsWidget(const_cast(this)); - config->setProperty("paintop", "chalkbrush"); // XXX: make this a const id string - writeConfiguration(config); - return config; -} diff --git a/plugins/paintops/chalk/kis_chalk_paintop_settings_widget.h b/plugins/paintops/chalk/kis_chalk_paintop_settings_widget.h deleted file mode 100644 index a0663ab2f0..0000000000 --- a/plugins/paintops/chalk/kis_chalk_paintop_settings_widget.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2008 Lukas Tvrdy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef KIS_CHALKPAINTOP_SETTINGS_WIDGET_H_ -#define KIS_CHALKPAINTOP_SETTINGS_WIDGET_H_ - -#include - -#include "ui_wdgchalkoptions.h" - -class KisChalkOpOption; - -class KisChalkPaintOpSettingsWidget : public KisPaintOpSettingsWidget -{ - Q_OBJECT - -public: - KisChalkPaintOpSettingsWidget(QWidget* parent = 0); - ~KisChalkPaintOpSettingsWidget() override; - - KisPropertiesConfigurationSP configuration() const override; - -public: - KisChalkOpOption* m_chalkOption; -}; - -#endif diff --git a/plugins/paintops/chalk/kis_chalkop_option.cpp b/plugins/paintops/chalk/kis_chalkop_option.cpp deleted file mode 100644 index 546c96f042..0000000000 --- a/plugins/paintops/chalk/kis_chalkop_option.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2008,2010 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include "kis_chalkop_option.h" - -#include "ui_wdgchalkoptions.h" - -class KisChalkOpOptionsWidget: public QWidget, public Ui::WdgChalkOptions -{ -public: - KisChalkOpOptionsWidget(QWidget *parent = 0) - : QWidget(parent) { - setupUi(this); - } -}; - -KisChalkOpOption::KisChalkOpOption() - : KisPaintOpOption(KisPaintOpOption::GENERAL, false) -{ - m_checkable = false; - m_options = new KisChalkOpOptionsWidget(); - m_options->hide(); - - setObjectName("KisChalkOpOption"); - - // initialize values - m_options->radiusSpinBox->setRange(0, 400); - m_options->radiusSpinBox->setValue(5); - m_options->radiusSpinBox->setSuffix(i18n(" px")); - - connect(m_options->radiusSpinBox, SIGNAL(valueChanged(int)), SLOT(emitSettingChanged())); - connect(m_options->inkDepletionCHBox, SIGNAL(clicked(bool)), SLOT(emitSettingChanged())); - connect(m_options->opacity, SIGNAL(clicked(bool)), SLOT(emitSettingChanged())); - connect(m_options->saturation, SIGNAL(clicked(bool)), SLOT(emitSettingChanged())); - setConfigurationPage(m_options); -} - -KisChalkOpOption::~KisChalkOpOption() -{ - // delete m_options; -} - -int KisChalkOpOption::radius() const -{ - return m_options->radiusSpinBox->value(); -} - - -void KisChalkOpOption::setRadius(int radius) const -{ - m_options->radiusSpinBox->setValue(radius); -} - - - -bool KisChalkOpOption::inkDepletion() const -{ - return m_options->inkDepletionCHBox->isChecked(); -} - - - -bool KisChalkOpOption::opacity() const -{ - return m_options->opacity->isChecked(); -} - - -bool KisChalkOpOption::saturation() const -{ - return m_options->saturation->isChecked(); -} - - -void KisChalkOpOption::writeOptionSetting(KisPropertiesConfigurationSP setting) const -{ - setting->setProperty(CHALK_RADIUS, radius()); - setting->setProperty(CHALK_INK_DEPLETION, inkDepletion()); - setting->setProperty(CHALK_USE_OPACITY, opacity()); - setting->setProperty(CHALK_USE_SATURATION, saturation()); -} - -void KisChalkOpOption::readOptionSetting(const KisPropertiesConfigurationSP setting) -{ - m_options->radiusSpinBox->setValue(setting->getInt(CHALK_RADIUS)); - m_options->inkDepletionCHBox->setChecked(setting->getBool(CHALK_INK_DEPLETION)); - m_options->opacity->setChecked(setting->getBool(CHALK_USE_OPACITY)); - m_options->saturation->setChecked(setting->getBool(CHALK_USE_SATURATION)); -} - - diff --git a/plugins/paintops/chalk/kis_chalkop_option.h b/plugins/paintops/chalk/kis_chalkop_option.h deleted file mode 100644 index 98a123dea1..0000000000 --- a/plugins/paintops/chalk/kis_chalkop_option.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2008,2010 Lukáš Tvrdý - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef KIS_CHALKOP_OPTION_H -#define KIS_CHALKOP_OPTION_H - -#include - -const QString CHALK_RADIUS = "Chalk/radius"; -const QString CHALK_INK_DEPLETION = "Chalk/inkDepletion"; -const QString CHALK_USE_OPACITY = "Chalk/opacity"; -const QString CHALK_USE_SATURATION = "Chalk/saturation"; - -class KisChalkOpOptionsWidget; - -class KisChalkOpOption : public KisPaintOpOption -{ -public: - KisChalkOpOption(); - ~KisChalkOpOption() override; - - void setRadius(int radius) const; - int radius() const; - - bool inkDepletion() const; - bool saturation() const; - bool opacity() const; - - void writeOptionSetting(KisPropertiesConfigurationSP setting) const override; - void readOptionSetting(const KisPropertiesConfigurationSP setting) override; - - -private: - - KisChalkOpOptionsWidget * m_options; - -}; - -class ChalkProperties : public KisBaseOption -{ -public: - int radius; - bool inkDepletion; - bool useOpacity; - bool useSaturation; - - void readOptionSettingImpl(const KisPropertiesConfiguration *settings) override { - radius = settings->getInt(CHALK_RADIUS); - inkDepletion = settings->getBool(CHALK_INK_DEPLETION); - useOpacity = settings->getBool(CHALK_USE_OPACITY); - useSaturation = settings->getBool(CHALK_USE_SATURATION); - } - - void writeOptionSettingImpl(KisPropertiesConfiguration* settings) const override { - settings->setProperty(CHALK_RADIUS, radius); - settings->setProperty(CHALK_INK_DEPLETION, inkDepletion); - settings->setProperty(CHALK_USE_OPACITY, useOpacity); - settings->setProperty(CHALK_USE_SATURATION, useSaturation); - } -}; - -#endif diff --git a/plugins/paintops/chalk/krita-chalk.png b/plugins/paintops/chalk/krita-chalk.png deleted file mode 100644 index fd4d0fa896..0000000000 Binary files a/plugins/paintops/chalk/krita-chalk.png and /dev/null differ diff --git a/plugins/paintops/chalk/kritachalkpaintop.json b/plugins/paintops/chalk/kritachalkpaintop.json deleted file mode 100644 index 3ede7370ac..0000000000 --- a/plugins/paintops/chalk/kritachalkpaintop.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Id": "Chalk brush", - "Type": "Service", - "X-KDE-Library": "kritachalkpaintop", - "X-KDE-ServiceTypes": [ - "Krita/Paintop" - ], - "X-Krita-Version": "28" -} diff --git a/plugins/paintops/chalk/wdgchalkoptions.ui b/plugins/paintops/chalk/wdgchalkoptions.ui deleted file mode 100644 index d6e11ed6fa..0000000000 --- a/plugins/paintops/chalk/wdgchalkoptions.ui +++ /dev/null @@ -1,169 +0,0 @@ - - - WdgChalkOptions - - - - 0 - 0 - 330 - 192 - - - - - 210 - 60 - - - - - 330 - 60 - - - - - - 1 - 11 - 321 - 131 - - - - - - - - - - 0 - 0 - - - - Brush Radius: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - Ink depletion - - - true - - - - - - - - - Opacity decrease - - - true - - - - - - - Saturation decrease - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - KisSliderSpinBox - QWidget -
kis_slider_spin_box.h
-
-
- - - - inkDepletionCHBox - toggled(bool) - opacity - setEnabled(bool) - - - 36 - 70 - - - 66 - 102 - - - - - inkDepletionCHBox - toggled(bool) - saturation - setEnabled(bool) - - - 18 - 77 - - - 74 - 129 - - - - -