1 /*
2  *  Copyright (c) 2008,2009,2010 Lukáš Tvrdý <lukast.dev@gmail.com>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 #include "kis_deform_paintop_settings.h"
19 #include "kis_deform_paintop_settings_widget.h"
20 #include "kis_deform_option.h"
21 
22 #include <kis_paintop_settings_widget.h>
23 #include <kis_brush_size_option.h>
24 
25 #include <kis_pressure_rotation_option.h>
26 #include <kis_pressure_opacity_option.h>
27 #include <kis_pressure_size_option.h>
28 #include <kis_pressure_rate_option.h>
29 #include <kis_curve_option_widget.h>
30 #include <kis_airbrush_option_widget.h>
31 #include <kis_compositeop_option.h>
32 
KisDeformPaintOpSettingsWidget(QWidget * parent)33 KisDeformPaintOpSettingsWidget::KisDeformPaintOpSettingsWidget(QWidget* parent)
34     : KisPaintOpSettingsWidget(parent)
35 {
36     m_deformOption = new KisDeformOption();
37     m_brushSizeOption = new KisBrushSizeOption();
38     m_brushSizeOption->setDiameter(200);
39 
40     addPaintOpOption(m_brushSizeOption, i18n("Brush size"));
41     addPaintOpOption(m_deformOption, i18n("Deform Options"));
42     addPaintOpOption(new KisCompositeOpOption(true), i18n("Blending Mode"));
43     addPaintOpOption(new KisCurveOptionWidget(new KisPressureOpacityOption(), i18n("Transparent"), i18n("Opaque")), i18n("Opacity"));
44     addPaintOpOption(new KisCurveOptionWidget(new KisPressureSizeOption(), i18n("0%"), i18n("100%")), i18n("Size"));
45     addPaintOpOption(new KisCurveOptionWidget(new KisPressureRotationOption(), i18n("-180°"), i18n("180°")), i18n("Rotation"));
46     addPaintOpOption(new KisAirbrushOptionWidget(false), i18n("Airbrush"));
47     addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate"));
48 }
49 
~KisDeformPaintOpSettingsWidget()50 KisDeformPaintOpSettingsWidget::~ KisDeformPaintOpSettingsWidget()
51 {
52 }
53 
54 
configuration() const55 KisPropertiesConfigurationSP KisDeformPaintOpSettingsWidget::configuration() const
56 {
57     KisDeformPaintOpSettings* config = new KisDeformPaintOpSettings();
58     config->setOptionsWidget(const_cast<KisDeformPaintOpSettingsWidget*>(this));
59     config->setProperty("paintop", "deformBrush");
60     writeConfiguration(config);
61     return config;
62 }
63 
64