summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/src/kernel/tqpixmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tqtinterface/qt4/src/kernel/tqpixmap.cpp')
-rw-r--r--tqtinterface/qt4/src/kernel/tqpixmap.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/tqtinterface/qt4/src/kernel/tqpixmap.cpp b/tqtinterface/qt4/src/kernel/tqpixmap.cpp
index 8fb5380..0e0cfee 100644
--- a/tqtinterface/qt4/src/kernel/tqpixmap.cpp
+++ b/tqtinterface/qt4/src/kernel/tqpixmap.cpp
@@ -60,7 +60,7 @@
#define VERIFY_TQPIXMAP_OBJECT_FUNCTION(x) \
if (!dynamic_cast<const TQPixmap*>(static_cast<const QPixmap*>(this))) { \
- printf("[WARNING] An attempt was made to access the TQPixmap::tqmask method from an object not of type TQPixmap [possibly QPixmap]\n\r\tThis may indicate creation and subsequent [illegal] downcasting of a QPixmap object to a TQPixmap object within your application\n\r\tNo pixmap was returned\n\r"); \
+ printf("[WARNING] An attempt was made to access the TQPixmap::mask method from an object not of type TQPixmap [possibly QPixmap]\n\r\tThis may indicate creation and subsequent [illegal] downcasting of a QPixmap object to a TQPixmap object within your application\n\r\tNo pixmap was returned\n\r"); \
return x; \
}
@@ -201,12 +201,12 @@ TQt::HANDLE TQPixmap::x11AppRootWindow( int screen ) {
return QX11Info::appRootWindow(screen);
}
-const TQBitmap *TQPixmap::tqmask() const {
+const TQBitmap *TQPixmap::mask() const {
// HACK
// Make absolutely sure that this is a TQPixmap object!
VERIFY_TQPIXMAP_OBJECT_FUNCTION(0)
- const QBitmap& ptrRef = mask();
+ const QBitmap& ptrRef = QPixmap::mask();
if (ptrRef.isNull() == true) {
return 0;
}
@@ -241,8 +241,8 @@ void TQPixmap::resize_helper(const QSize s)
}
// Mask too....
- if (!mask().isNull()) {
- TQBitmap m = mask();
+ if (!QPixmap::mask().isNull()) {
+ TQBitmap m = QPixmap::mask();
if (m.size() != QSize(w,h)) {
TQBitmap pmr(QSize(w, h));
pmr.fill(Qt::color0);
@@ -466,8 +466,8 @@ TQBitmap TQPixmap::createHeuristicMask( bool clipTight ) const {
You can retrieve the width(), height(), depth() and size() of a
pixmap. The enclosing rectangle is given by rect(). Pixmaps can be
filled with fill() and resized with resize(). You can create and
- set a tqmask with createHeuristicMask() and setMask(). Use
- selfMask() to see if the pixmap is identical to its tqmask.
+ set a mask with createHeuristicMask() and setMask(). Use
+ selfMask() to see if the pixmap is identical to its mask.
In addition to loading a pixmap from file using load() you can
also loadFromData(). You can control optimization with
@@ -1047,11 +1047,11 @@ void TQPixmap::resize( int w, int h )
qWarning("TQPixmap::resize: TODO: resize alpha data");
else
#endif // TQ_WS_X11
- if ( data->tqmask ) { // resize tqmask as well
- if ( data->selfmask ) { // preserve self-tqmask
+ if ( data->mask ) { // resize mask as well
+ if ( data->selfmask ) { // preserve self-mask
pm.setMask( *((TQBitmap*)&pm) );
- } else { // independent tqmask
- TQBitmap m = *data->tqmask;
+ } else { // independent mask
+ TQBitmap m = *data->mask;
m.resize( w, h );
pm.setMask( m );
}
@@ -1061,53 +1061,53 @@ void TQPixmap::resize( int w, int h )
/*!
- \fn const TQBitmap *TQPixmap::tqmask() const
+ \fn const TQBitmap *TQPixmap::mask() const
- Returns the tqmask bitmap, or 0 if no tqmask has been set.
+ Returns the mask bitmap, or 0 if no mask has been set.
\sa setMask(), TQBitmap, hasAlpha()
*/
/*!
- Sets a tqmask bitmap.
+ Sets a mask bitmap.
- The \a newtqmask bitmap defines the clip tqmask for this pixmap. Every
- pixel in \a newtqmask corresponds to a pixel in this pixmap. Pixel
- value 1 means opaque and pixel value 0 means transtqparent. The tqmask
+ The \a newmask bitmap defines the clip mask for this pixmap. Every
+ pixel in \a newmask corresponds to a pixel in this pixmap. Pixel
+ value 1 means opaque and pixel value 0 means transparent. The mask
must have the same size as this pixmap.
- \warning Setting the tqmask on a pixmap will cause any alpha channel
+ \warning Setting the mask on a pixmap will cause any alpha channel
data to be cleared. For example:
\code
TQPixmap alpha( "image-with-alpha.png" );
TQPixmap alphacopy = alpha;
- alphacopy.setMask( *alphacopy.tqmask() );
+ alphacopy.setMask( *alphacopy.mask() );
\endcode
Now, alpha and alphacopy are visually different.
- Setting a \link isNull() null\endlink tqmask resets the tqmask.
+ Setting a \link isNull() null\endlink mask resets the mask.
- \sa tqmask(), createHeuristicMask(), TQBitmap
+ \sa mask(), createHeuristicMask(), TQBitmap
*/
-void TQPixmap::setMask( const TQBitmap &newtqmask )
+void TQPixmap::setMask( const TQBitmap &newmask )
{
- const TQPixmap *tmp = &newtqmask; // dec cxx bug
+ const TQPixmap *tmp = &newmask; // dec cxx bug
if ( (data == tmp->data) ||
- ( newtqmask.handle() && newtqmask.handle() == handle() ) ) {
+ ( newmask.handle() && newmask.handle() == handle() ) ) {
TQPixmap m = tmp->copy( TRUE );
setMask( *((TQBitmap*)&m) );
- data->selfmask = TRUE; // tqmask == pixmap
+ data->selfmask = TRUE; // mask == pixmap
return;
}
- if ( newtqmask.isNull() ) { // reset the tqmask
- if (data->tqmask) {
+ if ( newmask.isNull() ) { // reset the mask
+ if (data->mask) {
detach();
data->selfmask = FALSE;
- delete data->tqmask;
- data->tqmask = 0;
+ delete data->mask;
+ data->mask = 0;
}
return;
}
@@ -1115,48 +1115,48 @@ void TQPixmap::setMask( const TQBitmap &newtqmask )
detach();
data->selfmask = FALSE;
- if ( newtqmask.width() != width() || newtqmask.height() != height() ) {
+ if ( newmask.width() != width() || newmask.height() != height() ) {
#if defined(TQT_CHECK_RANGE)
- qWarning( "TQPixmap::setMask: The pixmap and the tqmask must have "
+ qWarning( "TQPixmap::setMask: The pixmap and the mask must have "
"the same size" );
#endif
return;
}
#if defined(TQ_WS_MAC) || (defined(TQ_WS_X11) && !defined(TQT_NO_XFTFREETYPE))
- // when setting the tqmask, we get rid of the alpha channel completely
+ // when setting the mask, we get rid of the alpha channel completely
delete data->alphapm;
data->alphapm = 0;
#endif // TQ_WS_X11 && !TQT_NO_XFTFREETYPE
- delete data->tqmask;
+ delete data->mask;
TQBitmap* newmaskcopy;
- if ( newtqmask.tqmask() )
+ if ( newmask.mask() )
newmaskcopy = (TQBitmap*)new TQPixmap( tmp->copy( TRUE ) );
else
- newmaskcopy = new TQBitmap( newtqmask );
+ newmaskcopy = new TQBitmap( newmask );
#ifdef TQ_WS_X11
newmaskcopy->x11SetScreen( x11Screen() );
#endif
- data->tqmask = newmaskcopy;
+ data->mask = newmaskcopy;
}
/*!
\fn bool TQPixmap::selfMask() const
- Returns TRUE if the pixmap's tqmask is identical to the pixmap
+ Returns TRUE if the pixmap's mask is identical to the pixmap
itself; otherwise returns FALSE.
- \sa tqmask()
+ \sa mask()
*/
#ifndef TQT_NO_IMAGE_HEURISTIC_MASK
/*!
- Creates and returns a heuristic tqmask for this pixmap. It works by
+ Creates and returns a heuristic mask for this pixmap. It works by
selecting a color from one of the corners and then chipping away
pixels of that color, starting at all the edges.
- The tqmask may not be perfect but it should be reasonable, so you
+ The mask may not be perfect but it should be reasonable, so you
can do things such as the following:
\code
pm->setMask( pm->createHeuristicMask() );
@@ -1166,8 +1166,8 @@ void TQPixmap::setMask( const TQBitmap &newtqmask )
TQImage, non-trivial computations and a transformation back to a
TQBitmap.
- If \a clipTight is TRUE the tqmask is just large enough to cover the
- pixels; otherwise, the tqmask is larger than the data pixels.
+ If \a clipTight is TRUE the mask is just large enough to cover the
+ pixels; otherwise, the mask is larger than the data pixels.
\sa TQImage::createHeuristicMask()
*/
@@ -1505,7 +1505,7 @@ static TQPixmap grabChildWidgets( TQWidget * w )
((TQWidget *)child)->tqgeometry().intersects( w->rect() ) ) {
// those conditions aren't quite right, it's possible
// to have a grandchild completely outside its
- // grandtqparent, but partially inside its tqparent. no
+ // grandparent, but partially inside its parent. no
// point in optimizing for that.
// make sure to evaluate pos() first - who knows what