2
* Copyright (c) 2004 Bart Coppens <kde@bartcoppens.be>
3
* Copyright (c) 2010 Dmitry Kazakov <dimula73@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef KIS_INDIRECT_PAINTING_SUPPORT_H_
21
#define KIS_INDIRECT_PAINTING_SUPPORT_H_
23
#include "krita_export.h"
24
#include "kis_types.h"
29
* For classes that support indirect painting.
31
* XXX: Name doesn't suggest an object -- is KisIndirectPaintingLayer
32
* a better name? (BSAR)
34
class KRITAIMAGE_EXPORT KisIndirectPaintingSupport
36
KisIndirectPaintingSupport(const KisIndirectPaintingSupport&);
37
KisIndirectPaintingSupport& operator=(const KisIndirectPaintingSupport&);
40
KisIndirectPaintingSupport();
41
virtual ~KisIndirectPaintingSupport();
43
bool hasTemporaryTarget() const;
45
void setTemporaryTarget(KisPaintDeviceSP t);
46
void setTemporaryCompositeOp(const KoCompositeOp* c);
47
void setTemporaryOpacity(quint8 o);
50
* Writes the temporary target into the paint device of the layer.
51
* This action will lock the temporary target itself.
53
void mergeToLayer(KisLayerSP layer, const QRegion ®ion,
54
const QString &transactionText);
57
* Lock the temporary target.
58
* It should be done for guarding every access to
59
* temporaryTarget() or original()
60
* NOTE: well, not "every", but...
62
void lockTemporaryTarget() const;
65
* Unlock the temporary target
67
* \see lockTemporaryTarget()
69
void unlockTemporaryTarget() const;
71
KisPaintDeviceSP temporaryTarget();
72
const KisPaintDeviceSP temporaryTarget() const;
73
const KoCompositeOp* temporaryCompositeOp() const;
74
quint8 temporaryOpacity() const;
83
#endif /* KIS_INDIRECT_PAINTING_SUPPORT_H_ */