Commit 4e58ae0b authored by Dmitry Kazakov's avatar Dmitry Kazakov

Remove unused files

parent f377730c
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <kis_properties_configuration.h> #include <kis_properties_configuration.h>
#include <kis_paintop_options_widget.h> #include <kis_paintop_options_widget.h>
#include <kis_pressure_size_option.h> #include <kis_pressure_size_option.h>
#include <kis_pressure_rate_option.h>
#include <kis_curve_option_widget.h> #include <kis_curve_option_widget.h>
#include <kis_pressure_rotation_option.h> #include <kis_pressure_rotation_option.h>
#include <kis_pressure_scatter_option_widget.h> #include <kis_pressure_scatter_option_widget.h>
......
...@@ -35,8 +35,6 @@ set(kritalibpaintop_LIB_SRCS ...@@ -35,8 +35,6 @@ set(kritalibpaintop_LIB_SRCS
kis_pressure_sharpness_option.cpp kis_pressure_sharpness_option.cpp
kis_pressure_sharpness_option_widget.cpp kis_pressure_sharpness_option_widget.cpp
kis_pressure_mirror_option_widget.cpp kis_pressure_mirror_option_widget.cpp
kis_pressure_rate_option.cpp
kis_pressure_rate_option_widget.cpp
kis_pressure_rotation_option.cpp kis_pressure_rotation_option.cpp
kis_pressure_size_option.cpp kis_pressure_size_option.cpp
kis_pressure_spacing_option.cpp kis_pressure_spacing_option.cpp
......
/* This file is part of the KDE project
* Copyright (C) Boudewijn Rempt <boud@valdyas.org>, (C) 2008
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "kis_pressure_rate_option.h"
#include <klocale.h>
#include <kis_paint_device.h>
#include <widgets/kis_curve_widget.h>
#include <KoColor.h>
#include <KoColorSpaceConstants.h>
KisPressureRateOption::KisPressureRateOption()
: KisCurveOption(i18n("Rate"), "Rate", KisPaintOpOption::generalCategory(), true)
{
}
void KisPressureRateOption::setRate(int rate)
{
m_rate = rate;
}
int KisPressureRateOption::rate() const
{
return m_rate;
}
void KisPressureRateOption::writeOptionSetting(KisPropertiesConfiguration* setting) const
{
KisCurveOption::writeOptionSetting(setting);
setting->setProperty("RateValue", m_rate);
setting->setProperty("RateVersion", "2");
}
void KisPressureRateOption::readOptionSetting(const KisPropertiesConfiguration* setting)
{
KisCurveOption::readOptionSetting(setting);
if (setting->getString("RateVersion", "1") == "1") {
m_rate = setting->getInt("RatePressure");
setChecked(true);
}
else {
m_rate = setting->getInt("RateValue");
}
}
quint8 KisPressureRateOption::apply(quint8 opacity, const KisPaintInformation& info) const
{
opacity = (m_rate * 255) / 100;
if (isChecked()) {
opacity = qBound((qint32)OPACITY_TRANSPARENT_U8,
(qint32)(double(opacity) * computeValue(info) / PRESSURE_DEFAULT),
(qint32)OPACITY_OPAQUE_U8);
}
return opacity;
}
/* This file is part of the KDE project
* Copyright (C) Boudewijn Rempt <boud@valdyas.org>, (C) 2008
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KIS_PRESSURE_RATE_OPTION_H
#define KIS_PRESSURE_RATE_OPTION_H
#include "kis_curve_option.h"
#include <kis_paint_information.h>
#include <krita_export.h>
#include <kis_types.h>
class QSlider;
class KisPropertiesConfiguration;
/**
* The pressure opacity option defines a curve that is used to
* calculate the effect of pressure on the rate of the dab
*/
class PAINTOP_EXPORT KisPressureRateOption : public KisCurveOption
{
public:
KisPressureRateOption();
/**
* Set the opacity of the painter based on the rate
* and the curve (if checked) and return the old opacity
* of the painter.
*/
quint8 apply(quint8 opacity, const KisPaintInformation& info) const;
virtual void writeOptionSetting(KisPropertiesConfiguration* setting) const;
virtual void readOptionSetting(const KisPropertiesConfiguration* setting);
void setRate(int rate);
int rate() const;
private:
int m_rate;
};
#endif
/* This file is part of the KDE project
* Copyright (C) Boudewijn Rempt <boud@valdyas.org>, (C) 2008
* Copyright (C) Sven Langkamp <sven.langkamp@gmail.com>, (C) 2009
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "kis_pressure_rate_option_widget.h"
#include <QWidget>
#include <QCheckBox>
#include <QLabel>
#include <QSlider>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <klocale.h>
#include "kis_pressure_rate_option.h"
KisPressureRateOptionWidget::KisPressureRateOptionWidget()
: KisCurveOptionWidget(new KisPressureRateOption())
{
QWidget* w = new QWidget;
QLabel* rateLabel = new QLabel(i18n("Rate: "));
m_rateSlider = new QSlider();
m_rateSlider->setMinimum(0);
m_rateSlider->setMaximum(100);
m_rateSlider->setPageStep(1);
m_rateSlider->setValue(90);
m_rateSlider->setOrientation(Qt::Horizontal);
connect(m_rateSlider, SIGNAL(valueChanged(int)), SLOT(rateChanged(int)));
QHBoxLayout* hl = new QHBoxLayout;
hl->addWidget(rateLabel);
hl->addWidget(m_rateSlider);
QVBoxLayout* vl = new QVBoxLayout;
vl->addLayout(hl);
vl->addWidget(curveWidget());
w->setLayout(vl);
setConfigurationPage(w);
rateChanged(m_rateSlider->value());
}
void KisPressureRateOptionWidget::readOptionSetting(const KisPropertiesConfiguration* setting)
{
KisCurveOptionWidget::readOptionSetting(setting);
m_rateSlider->setValue(static_cast<KisPressureRateOption*>(curveOption())->rate());
}
void KisPressureRateOptionWidget::rateChanged(int rate)
{
static_cast<KisPressureRateOption*>(curveOption())->setRate(rate);
emit sigSettingChanged();
}
/* This file is part of the KDE project
* Copyright (C) Sven Langkamp <sven.langkamp@gmail.com>, (C) 2009
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KIS_PRESSURE_RATE_OPTION_WIDGET_H
#define KIS_PRESSURE_RATE_OPTION_WIDGET_H
#include "kis_curve_option_widget.h"
class QSlider;
class PAINTOP_EXPORT KisPressureRateOptionWidget : public KisCurveOptionWidget
{
Q_OBJECT
public:
KisPressureRateOptionWidget();
virtual void readOptionSetting(const KisPropertiesConfiguration* setting);
private slots:
void rateChanged(int rate);
private:
QSlider* m_rateSlider;
};
#endif // KIS_PRESSURE_RATE_OPTION_WIDGET_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment