summaryrefslogtreecommitdiffstats
path: root/chalk/core/kis_paint_layer.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 22:19:39 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 22:19:39 +0000
commit04766b207afba7961d4d802313e426f5a2fbef63 (patch)
treec888ea1027c793e2d0386a7e5a1a0cd077b03cb3 /chalk/core/kis_paint_layer.cc
parentb6edfe41c9395f2e20784cbf0e630af6426950a3 (diff)
downloadkoffice-04766b207afba7961d4d802313e426f5a2fbef63.tar.gz
koffice-04766b207afba7961d4d802313e426f5a2fbef63.zip
rename the following methods:
tqparent parent tqmask mask git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'chalk/core/kis_paint_layer.cc')
-rw-r--r--chalk/core/kis_paint_layer.cc84
1 files changed, 42 insertions, 42 deletions
diff --git a/chalk/core/kis_paint_layer.cc b/chalk/core/kis_paint_layer.cc
index 2df12e01..a4c5412d 100644
--- a/chalk/core/kis_paint_layer.cc
+++ b/chalk/core/kis_paint_layer.cc
@@ -39,7 +39,7 @@ KisPaintLayer::KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opaci
Q_ASSERT(img);
Q_ASSERT(dev);
m_paintdev = dev;
- m_tqmask = 0;
+ m_mask = 0;
m_maskAsSelection = 0;
m_paintdev->setParentLayer(this);
m_renderMask = false;
@@ -52,7 +52,7 @@ KisPaintLayer::KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opaci
{
Q_ASSERT(img);
m_paintdev = new KisPaintDevice(this, img->colorSpace(), name.latin1());
- m_tqmask = 0;
+ m_mask = 0;
m_maskAsSelection = 0;
m_renderMask = false;
m_editMask = true;
@@ -64,7 +64,7 @@ KisPaintLayer::KisPaintLayer(KisImage *img, const TQString& name, TQ_UINT8 opaci
Q_ASSERT(img);
Q_ASSERT(colorSpace);
m_paintdev = new KisPaintDevice(this, colorSpace, name.latin1());
- m_tqmask = 0;
+ m_mask = 0;
m_maskAsSelection = 0;
m_renderMask = false;
m_editMask = true;
@@ -76,8 +76,8 @@ KisPaintLayer::KisPaintLayer(const KisPaintLayer& rhs) :
m_paintdev = new KisPaintDevice( *rhs.m_paintdev.data() );
m_paintdev->setParentLayer(this);
if (rhs.hasMask()) {
- m_tqmask = new KisPaintDevice(*rhs.m_tqmask.data());
- m_tqmask->setParentLayer(this);
+ m_mask = new KisPaintDevice(*rhs.m_mask.data());
+ m_mask->setParentLayer(this);
}
m_renderMask = rhs.m_renderMask;
m_editMask = rhs.m_editMask;
@@ -93,8 +93,8 @@ KisPaintLayer::~KisPaintLayer()
if (m_paintdev != 0) {
m_paintdev->setParentLayer(0);
}
- if (m_tqmask != 0) {
- m_tqmask->setParentLayer(0);
+ if (m_mask != 0) {
+ m_mask->setParentLayer(0);
}
}
@@ -102,8 +102,8 @@ void KisPaintLayer::paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT3
{
if (m_paintdev && m_paintdev->hasSelection()) {
m_paintdev->selection()->paintSelection(img, x, y, w, h);
- } else if (m_tqmask && m_editMask && m_tqmask->hasSelection()) {
- m_tqmask->selection()->paintSelection(img, x, y, w, h);
+ } else if (m_mask && m_editMask && m_mask->hasSelection()) {
+ m_mask->selection()->paintSelection(img, x, y, w, h);
}
}
@@ -111,8 +111,8 @@ void KisPaintLayer::paintSelection(TQImage &img, const TQRect& scaledImageRect,
{
if (m_paintdev && m_paintdev->hasSelection()) {
m_paintdev->selection()->paintSelection(img, scaledImageRect, scaledImageSize, imageSize);
- } else if (m_tqmask && m_editMask && m_tqmask->hasSelection()) {
- m_tqmask->selection()->paintSelection(img, scaledImageRect, scaledImageSize, imageSize);
+ } else if (m_mask && m_editMask && m_mask->hasSelection()) {
+ m_mask->selection()->paintSelection(img, scaledImageRect, scaledImageSize, imageSize);
}
}
@@ -191,15 +191,15 @@ void KisPaintLayer::removeMask() {
if (!hasMask())
return;
- m_tqmask->setParentLayer(0);
- m_tqmask = 0;
+ m_mask->setParentLayer(0);
+ m_mask = 0;
m_maskAsSelection = 0;
setDirty();
emit sigMaskInfoChanged();
}
-// ### XXX Do we apply the tqmask outside the image boundaries too? I'd say no, but I'm not sure
+// ### XXX Do we apply the mask outside the image boundaries too? I'd say no, but I'm not sure
void KisPaintLayer::applyMask() {
if (!hasMask())
return;
@@ -221,18 +221,18 @@ void KisPaintLayer::applyMask() {
KisPaintDeviceSP KisPaintLayer::createMask() {
if (hasMask())
- return m_tqmask;
+ return m_mask;
kdDebug() << k_funcinfo << endl;
// Grey8 nicely fits our needs of being intuitively comparable to other apps'
- // tqmask layer interfaces. It does have an alpha component though, which is a bit
+ // mask layer interfaces. It does have an alpha component though, which is a bit
// less appropriate in this context.
- m_tqmask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()
+ m_mask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()
->getColorSpace(KisID("GRAYA"), 0));
genericMaskCreationHelper();
- return m_tqmask;
+ return m_mask;
}
// FIXME If from is a paint device is not grey8!!
@@ -241,22 +241,22 @@ void KisPaintLayer::createMaskFromPaintDevice(KisPaintDeviceSP from) {
return; // Or overwrite? XXX
kdDebug() << k_funcinfo << endl;
- m_tqmask = from; // KisPaintDevice(*from); XXX
+ m_mask = from; // KisPaintDevice(*from); XXX
genericMaskCreationHelper();
}
void KisPaintLayer::createMaskFromSelection(KisSelectionSP from) {
kdDebug() << k_funcinfo << endl;
- m_tqmask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()
+ m_mask = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()
->getColorSpace(KisID("GRAYA"), 0));
- m_tqmask->setParentLayer(this);
+ m_mask->setParentLayer(this);
m_maskAsSelection = new KisSelection(); // Anonymous selection is good enough
- // Default pixel is opaque white == don't tqmask?
+ // Default pixel is opaque white == don't mask?
TQ_UINT8 const defPixel[] = { 255, 255 };
- m_tqmask->dataManager()->setDefaultPixel(defPixel);
+ m_mask->dataManager()->setDefaultPixel(defPixel);
if (from) {
TQRect r(extent());
@@ -265,7 +265,7 @@ void KisPaintLayer::createMaskFromSelection(KisSelectionSP from) {
int h = r.height();
for (int y = r.y(); y < h; y++) {
KisHLineIteratorPixel srcIt = from->createHLineIterator(r.x(), y, w, false);
- KisHLineIteratorPixel dstIt = m_tqmask->createHLineIterator(r.x(), y, w, true);
+ KisHLineIteratorPixel dstIt = m_mask->createHLineIterator(r.x(), y, w, true);
while(!dstIt.isDone()) {
// XXX same remark as in convertMaskToSelection
@@ -286,7 +286,7 @@ void KisPaintLayer::createMaskFromSelection(KisSelectionSP from) {
KisPaintDeviceSP KisPaintLayer::getMask() {
createMask();
kdDebug() << k_funcinfo << endl;
- return m_tqmask;
+ return m_mask;
}
KisSelectionSP KisPaintLayer::getMaskAsSelection() {
@@ -310,7 +310,7 @@ void KisPaintLayer::setRenderMask(bool b) {
}
void KisPaintLayer::convertMaskToSelection(const TQRect& r) {
- KisRectIteratorPixel srcIt = m_tqmask->createRectIterator(r.x(), r.y(),
+ KisRectIteratorPixel srcIt = m_mask->createRectIterator(r.x(), r.y(),
r.width(), r.height(), false);
KisRectIteratorPixel dstIt = m_maskAsSelection->createRectIterator(r.x(), r.y(),
r.width(), r.height(), true);
@@ -326,13 +326,13 @@ void KisPaintLayer::convertMaskToSelection(const TQRect& r) {
}
void KisPaintLayer::genericMaskCreationHelper() {
- m_tqmask->setParentLayer(this);
+ m_mask->setParentLayer(this);
m_maskAsSelection = new KisSelection(); // Anonymous selection is good enough
- // Default pixel is opaque white == don't tqmask?
+ // Default pixel is opaque white == don't mask?
TQ_UINT8 const defPixel[] = { 255, 255 };
- m_tqmask->dataManager()->setDefaultPixel(defPixel);
+ m_mask->dataManager()->setDefaultPixel(defPixel);
setDirty();
emit sigMaskInfoChanged();
@@ -355,16 +355,16 @@ namespace {
class KisCreateMaskCommand : public KNamedCommand {
typedef KNamedCommand super;
KisPaintLayerSP m_layer;
- KisPaintDeviceSP m_tqmask;
+ KisPaintDeviceSP m_mask;
public:
KisCreateMaskCommand(const TQString& name, KisPaintLayer* layer)
: super(name), m_layer(layer) {}
virtual void execute() {
kdDebug() << k_funcinfo << endl;
- if (!m_tqmask)
- m_tqmask = m_layer->createMask();
+ if (!m_mask)
+ m_mask = m_layer->createMask();
else
- m_layer->createMaskFromPaintDevice(m_tqmask);
+ m_layer->createMaskFromPaintDevice(m_mask);
}
virtual void unexecute() {
m_layer->removeMask();
@@ -411,12 +411,12 @@ namespace {
class KisMaskToSelectionCommand : public KNamedCommand {
typedef KNamedCommand super;
KisPaintLayerSP m_layer;
- KisPaintDeviceSP m_tqmask;
+ KisPaintDeviceSP m_mask;
KisSelectionSP m_selection;
public:
KisMaskToSelectionCommand(const TQString& name, KisPaintLayer* layer)
: super(name), m_layer(layer) {
- m_tqmask = m_layer->getMask();
+ m_mask = m_layer->getMask();
if (m_layer->paintDevice()->hasSelection())
m_selection = m_layer->paintDevice()->selection();
else
@@ -431,18 +431,18 @@ namespace {
m_layer->paintDevice()->setSelection(m_selection);
else
m_layer->paintDevice()->deselect();
- m_layer->createMaskFromPaintDevice(m_tqmask);
+ m_layer->createMaskFromPaintDevice(m_mask);
}
};
class KisRemoveMaskCommand : public KNamedCommand {
typedef KNamedCommand super;
KisPaintLayerSP m_layer;
- KisPaintDeviceSP m_tqmask;
+ KisPaintDeviceSP m_mask;
public:
KisRemoveMaskCommand(const TQString& name, KisPaintLayer* layer)
: super(name), m_layer(layer) {
- m_tqmask = m_layer->getMask();
+ m_mask = m_layer->getMask();
}
virtual void execute() {
kdDebug() << k_funcinfo << endl;
@@ -451,19 +451,19 @@ namespace {
virtual void unexecute() {
// I hope that if the undo stack unwinds, it will end up here in the right
// state again; taking a deep-copy sounds like wasteful to me
- m_layer->createMaskFromPaintDevice(m_tqmask);
+ m_layer->createMaskFromPaintDevice(m_mask);
}
};
class KisApplyMaskCommand : public KNamedCommand {
typedef KNamedCommand super;
KisPaintLayerSP m_layer;
- KisPaintDeviceSP m_tqmask;
+ KisPaintDeviceSP m_mask;
KisPaintDeviceSP m_original;
public:
KisApplyMaskCommand(const TQString& name, KisPaintLayer* layer)
: super(name), m_layer(layer) {
- m_tqmask = m_layer->getMask();
+ m_mask = m_layer->getMask();
m_original = new KisPaintDevice(*m_layer->paintDevice());
}
virtual void execute() {
@@ -479,7 +479,7 @@ namespace {
gc.bitBlt(x, y, COMPOSITE_COPY, m_original, OPACITY_OPAQUE, x, y, w, h);
gc.end();
- m_layer->createMaskFromPaintDevice(m_tqmask);
+ m_layer->createMaskFromPaintDevice(m_mask);
}
};
}