2
* Copyright (c) 2008 Lukáš Tvrdý <lukast.dev@gmail.com>
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.
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.
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.
19
#include "kis_spray_paintop_factory.h"
20
#include "kis_spray_paintop.h"
21
#include "kis_spray_paintop_settings.h"
22
#include "kis_spray_paintop_settings_widget.h"
24
#include <KoInputDevice.h>
26
#include <kis_image.h>
27
#include <kis_painter.h>
28
#include <kis_types.h>
31
KisSprayPaintOpFactory::KisSprayPaintOpFactory()
35
KisSprayPaintOpFactory::~KisSprayPaintOpFactory()
39
KisPaintOp * KisSprayPaintOpFactory::createOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageWSP image = 0)
41
const KisSprayPaintOpSettings *spraySettings =
42
dynamic_cast<const KisSprayPaintOpSettings *>(settings.data());
43
Q_ASSERT(settings == 0 || spraySettings != 0);
45
KisPaintOp * op = new KisSprayPaintOp(spraySettings, painter, image);
50
KisPaintOpSettingsSP KisSprayPaintOpFactory::settings(const KoInputDevice& inputDevice, KisImageWSP image)
52
Q_UNUSED(inputDevice);
54
return new KisSprayPaintOpSettings();
57
KisPaintOpSettingsSP KisSprayPaintOpFactory::settings(KisImageWSP image)
60
return new KisSprayPaintOpSettings();
63
KisPaintOpSettingsWidget* KisSprayPaintOpFactory::createSettingsWidget(QWidget* parent)
65
return new KisSprayPaintOpSettingsWidget(parent);