[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Calligra/krita-fixsmudgebrush-silvioheinrich] 1dc361b: Removed
From:       Silvio Heinrich <plassy () web ! de>
Date:       2011-01-19 17:42:19
Message-ID: 20110119174219.1FD51A60C0 () git ! kde ! org
[Download RAW message or body]

commit 1dc361bd373b887e9dfa8712e230d46cbde67dd2
branch krita-fixsmudgebrush-silvioheinrich
Author: Silvio Heinrich <plassy@web.de>
Date:   Sun Jan 16 18:46:11 2011 +0100

    Removed "pressure composite option" classes.

diff --git a/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h \
b/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h index c585eb9..4f85c21 \
                100644
--- a/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h
+++ b/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h
@@ -31,7 +31,6 @@
 #include <kis_types.h>
 #include <kis_pressure_size_option.h>
 #include <kis_pressure_rate_option.h>
-#include <kis_pressure_composite_option.h>
 
 class KisBrushBasedPaintOpSettings;
 
diff --git a/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop_settings_widget.cpp \
b/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop_settings_widget.cpp \
                index 7974b5b..54cdedd 100644
--- a/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop_settings_widget.cpp
+++ b/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop_settings_widget.cpp
@@ -29,7 +29,6 @@
 #include <kis_pressure_rate_option.h>
 #include <kis_curve_option_widget.h>
 #include <kis_pressure_rate_option_widget.h>
-#include <kis_pressure_composite_option_widget.h>
 
 
 KisSmudgeOpSettingsWidget::KisSmudgeOpSettingsWidget(QWidget* parent)
diff --git a/krita/plugins/paintops/libpaintop/CMakeLists.txt \
b/krita/plugins/paintops/libpaintop/CMakeLists.txt index 8465a21..d2cbf4d 100644
--- a/krita/plugins/paintops/libpaintop/CMakeLists.txt
+++ b/krita/plugins/paintops/libpaintop/CMakeLists.txt
@@ -40,8 +40,6 @@ set(kritalibpaintop_LIB_SRCS
     kis_pressure_size_option.cpp
     kis_pressure_softness_option.cpp
     kis_pressure_mix_option.cpp
-    kis_pressure_composite_option.cpp
-    kis_pressure_composite_option_widget.cpp
     kis_sensor_selector.cc
     kis_text_brush_chooser.cpp
     kis_brush_based_paintop_options_widget.cpp
diff --git a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option.cpp \
b/krita/plugins/paintops/libpaintop/kis_pressure_composite_option.cpp deleted file \
mode 100644 index 36d9062..0000000
--- a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) Silvio Heinrich <plassy@web.de>, (C) 2011
- *
- * 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_composite_option.h"
-
-
-#include <klocale.h>
-
-#include <kis_painter.h>
-#include <widgets/kis_curve_widget.h>
-
-#include <KoColor.h>
-#include <KoColorSpace.h>
-#include <KoCompositeOp.h>
-
-KisPressureCompositeOption::KisPressureCompositeOption()
-    : KisCurveOption(i18n("Color"), "Color", KisPaintOpOption::brushCategory(), \
                false)
-{
-    setMinimumLabel(i18n("No Color"));
-    setMaximumLabel(i18n("Full Color"));
-}
-
-void KisPressureCompositeOption::writeOptionSetting(KisPropertiesConfiguration* \
                setting) const
-{
-    KisCurveOption::writeOptionSetting(setting);
-    setting->setProperty("CompositeOp", m_compositeOp);
-    setting->setProperty("CompositeRateValue", m_rate);
-}
-
-void KisPressureCompositeOption::readOptionSetting(const KisPropertiesConfiguration* \
                setting)
-{
-    KisCurveOption::readOptionSetting(setting);
-    m_compositeOp = setting->getString("CompositeOp");
-    m_rate        = setting->getDouble("CompositeRateValue");
-    
-    if(m_compositeOp == "") //TODO: test if compositeOp is valid instead of just \
                testing for an empty string
-        m_compositeOp = COMPOSITE_OVER;
-}
-
-
-void KisPressureCompositeOption::applyOpacityRate(KisPainter* painter, const \
                KisPaintInformation& info, qreal scaleMin, qreal scaleMax) const
-{
-    if(!isChecked()) {
-        painter->setOpacity((quint8)(scaleMax * 255.0));
-        return;
-    }
-    
-    qreal  rate    = scaleMin + (scaleMax - scaleMin) * m_rate; // scale m_rate into \
                the range scaleMin - scaleMax
-    quint8 opacity = qBound(OPACITY_TRANSPARENT_U8, (quint8)(rate * \
                computeValue(info) * 255.0), OPACITY_OPAQUE_U8);
-    
-    painter->setOpacity(opacity);
-}
-
-void KisPressureCompositeOption::applyCompositeOp(KisPainter* painter) const
-{
-    if(isChecked())
-        painter->setCompositeOp(m_compositeOp);
-}
diff --git a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option.h \
b/krita/plugins/paintops/libpaintop/kis_pressure_composite_option.h deleted file mode \
100644 index c30e8f4..0000000
--- a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) Silvio Heinrich <plassy@web.de>, (C) 2011
- *
- * 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_COMPOSITE_OPTION_H
-#define KIS_PRESSURE_COMPOSITE_OPTION_H
-
-#include "kis_curve_option.h"
-#include <kis_paint_information.h>
-#include <krita_export.h>
-#include <kis_types.h>
-
-class QSlider;
-class KisPropertiesConfiguration;
-class KisPainter;
-
-class PAINTOP_EXPORT KisPressureCompositeOption : public KisCurveOption
-{
-public:
-    KisPressureCompositeOption();
-
-    /**
-     * Set the composite mode and opacity of the painter based on the user selection
-     * and the pressure curve (if checked)
-     */
-    void applyOpacityRate(KisPainter* painter, const KisPaintInformation& info, \
                qreal scaleMin=0.0, qreal scaleMax=1.0) const;
-    void applyCompositeOp(KisPainter* painter) const;
-
-    void writeOptionSetting(KisPropertiesConfiguration* setting) const;
-    void readOptionSetting(const KisPropertiesConfiguration* setting);
-    
-    void setCompositeOp(const QString& compositeOp) { m_compositeOp = compositeOp; }
-    QString getCompositeOp() { return m_compositeOp; }
-    
-    void setRate(qreal rate) { m_rate = qBound(0.0, rate, 1.0); }
-    qreal getRate() const { return m_rate; }
-    
-private:
-    QString m_compositeOp;
-    qreal   m_rate;
-};
-
-#endif // KIS_PRESSURE_COMPOSITE_OPTION_H
diff --git a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option_widget.cpp \
b/krita/plugins/paintops/libpaintop/kis_pressure_composite_option_widget.cpp deleted \
file mode 100644 index cfdc50f..0000000
--- a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option_widget.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) Silvio Heinrich <plassy@web.de>, (C) 2011
- *
- * 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_composite_option_widget.h"
-#include "kis_pressure_composite_option.h"
-
-#include <kis_slider_spin_box.h>
-#include <KoCompositeOp.h>
-
-#include <QWidget>
-#include <QCheckBox>
-#include <QLabel>
-#include <QComboBox>
-#include <QSlider>
-#include <QVBoxLayout>
-#include <QGridLayout>
-
-#include <klocale.h>
-
-const static int MAX_SLIDER_VALUE = 1000;
-
-KisPressureCompositeOptionWidget::KisPressureCompositeOptionWidget()
-    : KisCurveOptionWidget(new KisPressureCompositeOption())
-{
-    QWidget* widget    = new QWidget;
-    QLabel*  modeLabel = new QLabel(i18n("Mode: "));
-    QLabel*  rateLabel = new QLabel(i18n("Rate: "));
-    
-    m_compositeOpBox = new QComboBox();
-    m_compositeOpBox->addItem(COMPOSITE_OVER);
-    m_compositeOpBox->addItem(COMPOSITE_OVERLAY);
-    m_compositeOpBox->addItem(COMPOSITE_SCREEN);
-    m_compositeOpBox->addItem(COMPOSITE_ADD);
-    m_compositeOpBox->addItem(COMPOSITE_SUBTRACT);
-    m_compositeOpBox->addItem(COMPOSITE_DIVIDE);
-    m_compositeOpBox->addItem(COMPOSITE_BURN);
-    m_compositeOpBox->addItem(COMPOSITE_DODGE);
-    m_compositeOpBox->addItem(COMPOSITE_COLOR);
-    m_compositeOpBox->addItem(COMPOSITE_HARD_LIGHT);
-    m_compositeOpBox->addItem(COMPOSITE_SOFT_LIGHT);
-    
-    m_rateSlider = new KisDoubleSliderSpinBox();
-    m_rateSlider->setRange(0.0, 1.0, 2);
-    m_rateSlider->setValue(0.3);
-    m_rateSlider->setSingleStep(0.01);
-    m_rateSlider->setSuffix("%");
-    
-    connect(m_compositeOpBox, SIGNAL(activated(QString)), this, \
                SLOT(compositeOpChanged(QString)));
-    connect(m_rateSlider, SIGNAL(valueChanged(qreal)), this, \
                SLOT(rateChanged(qreal)));
-    
-    QGridLayout* gridLayout = new QGridLayout();
-    gridLayout->addWidget(modeLabel, 0, 0);
-    gridLayout->addWidget(m_compositeOpBox, 0, 1);
-    gridLayout->addWidget(rateLabel, 1, 0);
-    gridLayout->addWidget(m_rateSlider, 1, 1);
-    gridLayout->setColumnStretch(1, 1);
-
-    QVBoxLayout* vBoxLayout = new QVBoxLayout;
-    vBoxLayout->addLayout(gridLayout);
-    vBoxLayout->addWidget(curveWidget());
-
-    widget->setLayout(vBoxLayout);
-    
-    setConfigurationPage(widget);
-    
-    compositeOpChanged(COMPOSITE_OVER);
-    rateChanged(m_rateSlider->value());
-}
-
-void KisPressureCompositeOptionWidget::readOptionSetting(const \
                KisPropertiesConfiguration* setting)
-{
-    KisCurveOptionWidget::readOptionSetting(setting);
-    
-    QString compositeOp = \
                static_cast<KisPressureCompositeOption*>(curveOption())->getCompositeOp();
                
-    
-    for(int i=0; i<m_compositeOpBox->count(); ++i) {
-        if(m_compositeOpBox->itemText(i) == compositeOp) {
-            m_compositeOpBox->setCurrentIndex(i);
-            break;
-        }
-    }
-    
-    m_rateSlider->setValue(static_cast<KisPressureCompositeOption*>(curveOption())->getRate());
                
-}
-
-void KisPressureCompositeOptionWidget::compositeOpChanged(const QString& \
                compositeOp)
-{
-    static_cast<KisPressureCompositeOption*>(curveOption())->setCompositeOp(compositeOp);
                
-    emit sigSettingChanged();
-}
-
-void KisPressureCompositeOptionWidget::rateChanged(qreal rate)
-{
-    static_cast<KisPressureCompositeOption*>(curveOption())->setRate(rate);
-    emit sigSettingChanged();
-}
diff --git a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option_widget.h \
b/krita/plugins/paintops/libpaintop/kis_pressure_composite_option_widget.h deleted \
file mode 100644 index 5bc3073..0000000
--- a/krita/plugins/paintops/libpaintop/kis_pressure_composite_option_widget.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) Silvio Heinrich <plassy@web.de>, (C) 2011
- *
- * 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_COMPOSITE_OPTION_WIDGET_H
-#define KIS_PRESSURE_COMPOSITE_OPTION_WIDGET_H
-
-#include "kis_curve_option_widget.h"
-
-class QComboBox;
-class KisDoubleSliderSpinBox;
-
-class PAINTOP_EXPORT KisPressureCompositeOptionWidget : public KisCurveOptionWidget
-{
-    Q_OBJECT
-    
-public:
-    KisPressureCompositeOptionWidget();
-
-    void readOptionSetting(const KisPropertiesConfiguration* setting);
-    
-private slots:
-     void compositeOpChanged(const QString& compositeOp);
-     void rateChanged(qreal rate);
-    
-private:
-    QComboBox* m_compositeOpBox;
-    KisDoubleSliderSpinBox* m_rateSlider;
-};
-
-#endif // KIS_PRESSURE_COMPOSITE_OPTION_WIDGET_H


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic