summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrPixmapObject.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kpresenter/KPrPixmapObject.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpresenter/KPrPixmapObject.cpp')
-rw-r--r--kpresenter/KPrPixmapObject.cpp232
1 files changed, 116 insertions, 116 deletions
diff --git a/kpresenter/KPrPixmapObject.cpp b/kpresenter/KPrPixmapObject.cpp
index 34e3ff3f..d64c5b60 100644
--- a/kpresenter/KPrPixmapObject.cpp
+++ b/kpresenter/KPrPixmapObject.cpp
@@ -25,14 +25,14 @@
#include <stdlib.h>
#include <float.h>
-#include <qbuffer.h>
-#include <qpainter.h>
-#include <qwmatrix.h>
-#include <qfileinfo.h>
-#include <qpixmap.h>
-#include <qdom.h>
-#include <qimage.h>
-#include <qbitmap.h>
+#include <tqbuffer.h>
+#include <tqpainter.h>
+#include <tqwmatrix.h>
+#include <tqfileinfo.h>
+#include <tqpixmap.h>
+#include <tqdom.h>
+#include <tqimage.h>
+#include <tqbitmap.h>
#include <kdebug.h>
#include <kimageeffect.h>
@@ -53,18 +53,18 @@ KPrPixmapObject::KPrPixmapObject( KoPictureCollection *_imageCollection )
: KPr2DObject()
{
imageCollection = _imageCollection;
- pen = KoPen( Qt::black, 1.0, Qt::NoPen );
+ pen = KoPen( TQt::black, 1.0, Qt::NoPen );
mirrorType = PM_NORMAL;
depth = 0;
swapRGB = false;
grayscal = false;
bright = 0;
m_effect = IE_NONE;
- m_ie_par1 = QVariant();
- m_ie_par2 = QVariant();
- m_ie_par3 = QVariant();
- // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!)
- m_cachedPixmap.setOptimization(QPixmap::MemoryOptim);
+ m_ie_par1 = TQVariant();
+ m_ie_par2 = TQVariant();
+ m_ie_par3 = TQVariant();
+ // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!)
+ m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim);
keepRatio = true;
}
@@ -74,18 +74,18 @@ KPrPixmapObject::KPrPixmapObject( KoPictureCollection *_imageCollection, const K
imageCollection = _imageCollection;
ext = KoSize(); // invalid size means unset
- pen = KoPen( Qt::black, 1.0, Qt::NoPen );
+ pen = KoPen( TQt::black, 1.0, Qt::NoPen );
mirrorType = PM_NORMAL;
depth = 0;
swapRGB = false;
grayscal = false;
bright = 0;
m_effect = IE_NONE;
- m_ie_par1 = QVariant();
- m_ie_par2 = QVariant();
- m_ie_par3 = QVariant();
- // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!)
- m_cachedPixmap.setOptimization(QPixmap::MemoryOptim);
+ m_ie_par1 = TQVariant();
+ m_ie_par2 = TQVariant();
+ m_ie_par3 = TQVariant();
+ // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!)
+ m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim);
setPicture( key );
}
@@ -97,9 +97,9 @@ DCOPObject* KPrPixmapObject::dcopObject()
return dcop;
}
-QString KPrPixmapObject::convertValueToPercent( int val ) const
+TQString KPrPixmapObject::convertValueToPercent( int val ) const
{
- return QString::number( val )+"%";
+ return TQString::number( val )+"%";
}
void KPrPixmapObject::saveOasisPictureElement( KoGenStyle &styleobjectauto ) const
@@ -122,7 +122,7 @@ void KPrPixmapObject::saveOasisPictureElement( KoGenStyle &styleobjectauto ) con
case IE_CHANNEL_INTENSITY:
{
//for the moment kpresenter support just one channel
- QString percent = convertValueToPercent( m_ie_par1.toInt() );
+ TQString percent = convertValueToPercent( m_ie_par1.toInt() );
KImageEffect::RGBComponent channel = static_cast<KImageEffect::RGBComponent>( m_ie_par2.toInt() );
switch( channel )
{
@@ -221,12 +221,12 @@ const char * KPrPixmapObject::getOasisElementName() const
// Deprecated, same as KPrPixmapObject::loadPicture
-void KPrPixmapObject::loadImage( const QString & fileName )
+void KPrPixmapObject::loadImage( const TQString & fileName )
{
loadPicture( fileName );
}
-void KPrPixmapObject::loadPicture( const QString & fileName )
+void KPrPixmapObject::loadPicture( const TQString & fileName )
{
image = imageCollection->loadPicture( fileName );
}
@@ -257,14 +257,14 @@ void KPrPixmapObject::reload( void )
}
}
-QDomDocumentFragment KPrPixmapObject::save( QDomDocument& doc, double offset )
+TQDomDocumentFragment KPrPixmapObject::save( TQDomDocument& doc, double offset )
{
- QDomDocumentFragment fragment=KPr2DObject::save(doc, offset);
- QDomElement elem=doc.createElement("KEY");
+ TQDomDocumentFragment fragment=KPr2DObject::save(doc, offset);
+ TQDomElement elem=doc.createElement("KEY");
image.getKey().saveAttributes(elem);
fragment.appendChild(elem);
- QDomElement elemSettings = doc.createElement( "PICTURESETTINGS" );
+ TQDomElement elemSettings = doc.createElement( "PICTURESETTINGS" );
elemSettings.setAttribute( "mirrorType", static_cast<int>( mirrorType ) );
elemSettings.setAttribute( "depth", depth );
@@ -274,7 +274,7 @@ QDomDocumentFragment KPrPixmapObject::save( QDomDocument& doc, double offset )
fragment.appendChild( elemSettings );
if (m_effect!=IE_NONE) {
- QDomElement imageEffects = doc.createElement("EFFECTS");
+ TQDomElement imageEffects = doc.createElement("EFFECTS");
imageEffects.setAttribute("type", static_cast<int>(m_effect));
if (m_ie_par1.isValid())
imageEffects.setAttribute("param1", m_ie_par1.toString());
@@ -299,43 +299,43 @@ void KPrPixmapObject::loadOasisPictureEffect(KoOasisContext & context )
if ( styleStack.hasAttributeNS( KoXmlNS::draw, "contrast" ) )
{
- QString str( styleStack.attributeNS( KoXmlNS::draw, "contrast" ) );
+ TQString str( styleStack.attributeNS( KoXmlNS::draw, "contrast" ) );
str = str.remove( '%' );
int val = str.toInt();
m_effect = IE_CONTRAST;
val = ( int )( 255.0 *val/100.0 );
- m_ie_par1 = QVariant(val);
+ m_ie_par1 = TQVariant(val);
}
if ( styleStack.hasAttributeNS( KoXmlNS::draw, "red" ) && styleStack.attributeNS( KoXmlNS::draw, "red" ) != "0%" )
{
- QString str( styleStack.attributeNS( KoXmlNS::draw, "red" ) );
+ TQString str( styleStack.attributeNS( KoXmlNS::draw, "red" ) );
str = str.remove( '%' );
int val = str.toInt();
m_effect = IE_CHANNEL_INTENSITY;
- m_ie_par1 = QVariant(val);
- m_ie_par2 = QVariant( ( int )KImageEffect::Red );
+ m_ie_par1 = TQVariant(val);
+ m_ie_par2 = TQVariant( ( int )KImageEffect::Red );
}
if ( styleStack.hasAttributeNS( KoXmlNS::draw, "green" ) && styleStack.attributeNS( KoXmlNS::draw, "green" ) != "0%" )
{
- QString str( styleStack.attributeNS( KoXmlNS::draw, "green" ) );
+ TQString str( styleStack.attributeNS( KoXmlNS::draw, "green" ) );
str = str.remove( '%' );
int val = str.toInt();
m_effect = IE_CHANNEL_INTENSITY;
- m_ie_par1 = QVariant(val);
- m_ie_par2 = QVariant( ( int )KImageEffect::Green );
+ m_ie_par1 = TQVariant(val);
+ m_ie_par2 = TQVariant( ( int )KImageEffect::Green );
}
if ( styleStack.hasAttributeNS( KoXmlNS::draw, "blue" ) && styleStack.attributeNS( KoXmlNS::draw, "blue" ) != "0%" )
{
- QString str( styleStack.attributeNS( KoXmlNS::draw, "blue" ) );
+ TQString str( styleStack.attributeNS( KoXmlNS::draw, "blue" ) );
str = str.remove( '%' );
int val = str.toInt();
m_effect = IE_CHANNEL_INTENSITY;
- m_ie_par1 = QVariant(val);
- m_ie_par2 = QVariant( ( int )KImageEffect::Blue );
+ m_ie_par1 = TQVariant(val);
+ m_ie_par2 = TQVariant( ( int )KImageEffect::Blue );
}
if ( styleStack.hasAttributeNS( KoXmlNS::draw, "luminance" ) )
{
- QString str( styleStack.attributeNS( KoXmlNS::draw, "luminance" ) );
+ TQString str( styleStack.attributeNS( KoXmlNS::draw, "luminance" ) );
str = str.remove( '%' );
bright = str.toInt();
}
@@ -348,24 +348,24 @@ void KPrPixmapObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainS
saveOasisPictureElement( styleObjectAuto );
}
-void KPrPixmapObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+void KPrPixmapObject::loadOasis(const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
{
//load it into kpresenter_doc
KPr2DObject::loadOasis( element, context, info );
loadOasisPictureEffect( context );
- QDomNode imageBox = KoDom::namedItemNS( element, KoXmlNS::draw, "image" );
- const QString href( imageBox.toElement().attributeNS( KoXmlNS::xlink, "href", QString::null) );
+ TQDomNode imageBox = KoDom::namedItemNS( element, KoXmlNS::draw, "image" );
+ const TQString href( imageBox.toElement().attributeNS( KoXmlNS::xlink, "href", TQString()) );
kdDebug()<<" href: "<<href<<endl;
if ( !href.isEmpty() /*&& href[0] == '#'*/ )
{
- QString strExtension;
- const int result=href.findRev(".");
+ TQString strExtension;
+ const int result=href.tqfindRev(".");
if (result>=0)
{
strExtension=href.mid(result+1); // As we are using KoPicture, the extension should be without the dot.
}
- QString filename(href/*.mid(1)*/);
- const KoPictureKey key(filename, QDateTime::currentDateTime(Qt::UTC));
+ TQString filename(href/*.mid(1)*/);
+ const KoPictureKey key(filename, TQDateTime::tqcurrentDateTime(Qt::UTC));
image.setKey(key);
KoStore* store = context.store();
@@ -382,10 +382,10 @@ void KPrPixmapObject::loadOasis(const QDomElement &element, KoOasisContext & con
}
-double KPrPixmapObject::load(const QDomElement &element)
+double KPrPixmapObject::load(const TQDomElement &element)
{
double offset=KPr2DObject::load(element);
- QDomElement e=element.namedItem("KEY").toElement();
+ TQDomElement e=element.namedItem("KEY").toElement();
if(!e.isNull()) {
KoPictureKey key;
key.loadAttributes( e );
@@ -404,8 +404,8 @@ double KPrPixmapObject::load(const QDomElement &element)
}
} else {
bool openPic = true;
- QString _data;
- QString _fileName;
+ TQString _data;
+ TQString _fileName;
if(e.hasAttribute("data"))
_data=e.attribute("data");
if ( _data.isEmpty() )
@@ -416,12 +416,12 @@ double KPrPixmapObject::load(const QDomElement &element)
_fileName=e.attribute("filename");
if ( !_fileName.isEmpty() )
{
- if ( int _envVarB = _fileName.find( '$' ) >= 0 )
+ if ( int _envVarB = _fileName.tqfind( '$' ) >= 0 )
{
- int _envVarE = _fileName.find( '/', _envVarB );
- // ### FIXME: it should be QString::local8Bit instead of QFile::encodeName, shouldn't it?
- QString path = getenv( QFile::encodeName(_fileName.mid( _envVarB, _envVarE-_envVarB )) );
- _fileName.replace( _envVarB-1, _envVarE-_envVarB+1, path );
+ int _envVarE = _fileName.tqfind( '/', _envVarB );
+ // ### FIXME: it should be TQString::local8Bit instead of TQFile::encodeName, shouldn't it?
+ TQString path = getenv( TQFile::encodeName(_fileName.mid( _envVarB, _envVarE-_envVarB )) );
+ _fileName.tqreplace( _envVarB-1, _envVarE-_envVarB+1, path );
}
}
@@ -433,10 +433,10 @@ double KPrPixmapObject::load(const QDomElement &element)
KoPictureKey key( _fileName );
image.clear();
image.setKey(key);
- QByteArray rawData=_data.utf8(); // XPM is normally ASCII, therefore UTF-8
+ TQByteArray rawData=_data.utf8(); // XPM is normally ASCII, therefore UTF-8
rawData[rawData.size()-1]=char(10); // Replace the NULL character by a LINE FEED
- QBuffer buffer(rawData); // ### TODO: open?
- image.loadXpm(&buffer);
+ TQBuffer buffer(rawData); // ### TODO: open?
+ image.loadXpm(TQT_TQIODEVICE(&buffer));
}
}
}
@@ -479,17 +479,17 @@ double KPrPixmapObject::load(const QDomElement &element)
if (e.hasAttribute("type"))
m_effect = static_cast<ImageEffect>(e.attribute("type").toInt());
if (e.hasAttribute("param1"))
- m_ie_par1 = QVariant(e.attribute("param1"));
+ m_ie_par1 = TQVariant(e.attribute("param1"));
else
- m_ie_par1 = QVariant();
+ m_ie_par1 = TQVariant();
if (e.hasAttribute("param2"))
- m_ie_par2 = QVariant(e.attribute("param2"));
+ m_ie_par2 = TQVariant(e.attribute("param2"));
else
- m_ie_par2 = QVariant();
+ m_ie_par2 = TQVariant();
if (e.hasAttribute("param3"))
- m_ie_par3 = QVariant(e.attribute("param3"));
+ m_ie_par3 = TQVariant(e.attribute("param3"));
else
- m_ie_par3 = QVariant();
+ m_ie_par3 = TQVariant();
}
else
m_effect = IE_NONE;
@@ -497,7 +497,7 @@ double KPrPixmapObject::load(const QDomElement &element)
return offset;
}
-void KPrPixmapObject::drawShadow( QPainter* _painter, KoZoomHandler* _zoomHandler)
+void KPrPixmapObject::drawShadow( TQPainter* _painter, KoZoomHandler* _zoomHandler)
{
const double ox = orig.x();
const double oy = orig.y();
@@ -506,7 +506,7 @@ void KPrPixmapObject::drawShadow( QPainter* _painter, KoZoomHandler* _zoomHandle
_painter->save();
- QPen pen2 = pen.zoomedPen( _zoomHandler );
+ TQPen pen2 = pen.zoomedPen( _zoomHandler );
_painter->setPen( pen2 );
_painter->setBrush( getBrush() );
@@ -516,24 +516,24 @@ void KPrPixmapObject::drawShadow( QPainter* _painter, KoZoomHandler* _zoomHandle
getShadowCoords( sx, sy );
_painter->translate( _zoomHandler->zoomItX( ox ), _zoomHandler->zoomItY( oy ) );
- _painter->setPen( QPen( shadowColor ) );
+ _painter->setPen( TQPen( shadowColor ) );
_painter->setBrush( shadowColor );
if ( kAbs(angle) <= DBL_EPSILON )
_painter->drawRect( _zoomHandler->zoomItX( sx ), _zoomHandler->zoomItY( sy ),
_zoomHandler->zoomItX( ext.width() ), _zoomHandler->zoomItY( ext.height() ) );
else
{
- QSize bs = QSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) );
- QRect br = QRect( 0, 0, bs.width(), bs.height() );
+ TQSize bs = TQSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) );
+ TQRect br = TQRect( 0, 0, bs.width(), bs.height() );
int pw = br.width();
int ph = br.height();
- QRect rr = br;
+ TQRect rr = br;
int pixYPos = -rr.y();
int pixXPos = -rr.x();
- br.moveTopLeft( QPoint( -br.width() / 2, -br.height() / 2 ) );
- rr.moveTopLeft( QPoint( -rr.width() / 2, -rr.height() / 2 ) );
+ br.moveTopLeft( TQPoint( -br.width() / 2, -br.height() / 2 ) );
+ rr.moveTopLeft( TQPoint( -rr.width() / 2, -rr.height() / 2 ) );
- QWMatrix m;
+ TQWMatrix m;
m.translate( pw / 2, ph / 2 );
m.rotate( angle );
m.translate( rr.left() + pixXPos + _zoomHandler->zoomItX( sx ),
@@ -547,23 +547,23 @@ void KPrPixmapObject::drawShadow( QPainter* _painter, KoZoomHandler* _zoomHandle
_painter->restore();
}
-QPixmap KPrPixmapObject::generatePixmap(KoZoomHandler*_zoomHandler)
+TQPixmap KPrPixmapObject::generatePixmap(KoZoomHandler*_zoomHandler)
{
- const double penw = _zoomHandler->zoomItX( ( ( pen.style() == Qt::NoPen ) ? 1 : pen.width() ) / 2.0 );
+ const double penw = _zoomHandler->zoomItX( ( ( pen.style() == TQt::NoPen ) ? 1 : pen.width() ) / 2.0 );
- QSize size( _zoomHandler->zoomSize( ext ) );
+ TQSize size( _zoomHandler->zoomSize( ext ) );
//kdDebug(33001) << "KPrPixmapObject::generatePixmap size= " << size << endl;
- QPixmap pixmap(size);
- QPainter paint;
+ TQPixmap pixmap(size);
+ TQPainter paint;
paint.begin( &pixmap );
- pixmap.fill( Qt::white );
+ pixmap.fill( TQt::white );
// Draw background
- paint.setPen( Qt::NoPen );
+ paint.setPen( TQt::NoPen );
paint.setBrush( getBrush() );
- QRect rect( (int)( penw ), (int)( penw ),
+ TQRect rect( (int)( penw ), (int)( penw ),
(int)( _zoomHandler->zoomItX( ext.width() ) - 2.0 * penw ),
(int)( _zoomHandler->zoomItY( ext.height() ) - 2.0 * penw ) );
@@ -583,7 +583,7 @@ QPixmap KPrPixmapObject::generatePixmap(KoZoomHandler*_zoomHandler)
image.clearCache(); // Release the memoy of the picture cache
image.setAlphaBuffer(true);
- QBitmap tmpMask;
+ TQBitmap tmpMask;
tmpMask = image.createAlphaMask().scale(size);
pixmap.setMask(tmpMask);
@@ -591,7 +591,7 @@ QPixmap KPrPixmapObject::generatePixmap(KoZoomHandler*_zoomHandler)
return pixmap;
}
-void KPrPixmapObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+void KPrPixmapObject::draw( TQPainter *_painter, KoTextZoomHandler*_zoomHandler,
int pageNum, SelectionMode selectionMode, bool drawContour )
{
if ( image.isNull() ) return;
@@ -603,24 +603,24 @@ void KPrPixmapObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
const double oy = orig.y();
const double ow = ext.width();
const double oh = ext.height();
- const double penw = _zoomHandler->zoomItX( ( ( pen.style() == Qt::NoPen ) ? 1.0 : pen.width() ) / 2.0 );
+ const double penw = _zoomHandler->zoomItX( ( ( pen.style() == TQt::NoPen ) ? 1.0 : pen.width() ) / 2.0 );
_painter->save();
_painter->translate( _zoomHandler->zoomItX( ox ), _zoomHandler->zoomItY( oy ) );
if ( kAbs(angle)> DBL_EPSILON ) {
- QSize bs = QSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) );
- QRect br = QRect( 0, 0, bs.width(), bs.height() );
+ TQSize bs = TQSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) );
+ TQRect br = TQRect( 0, 0, bs.width(), bs.height() );
int pw = br.width();
int ph = br.height();
- QRect rr = br;
+ TQRect rr = br;
int pixYPos = -rr.y();
int pixXPos = -rr.x();
- br.moveTopLeft( QPoint( -br.width() / 2, -br.height() / 2 ) );
- rr.moveTopLeft( QPoint( -rr.width() / 2, -rr.height() / 2 ) );
+ br.moveTopLeft( TQPoint( -br.width() / 2, -br.height() / 2 ) );
+ rr.moveTopLeft( TQPoint( -rr.width() / 2, -rr.height() / 2 ) );
- QWMatrix m;
+ TQWMatrix m;
m.translate( pw / 2, ph / 2 );
m.rotate( angle );
m.translate( rr.left() + pixXPos, rr.top() + pixYPos );
@@ -629,9 +629,9 @@ void KPrPixmapObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
if ( !drawContour )
{
- QRect rect( 0, 0, (int)( _zoomHandler->zoomItX( ow ) ),
+ TQRect rect( 0, 0, (int)( _zoomHandler->zoomItX( ow ) ),
(int)( _zoomHandler->zoomItY( oh ) ) );
- // ### HACK QT seems not to be able to correctly compare QVariant
+ // ### HACK QT seems not to be able to correctly compare TQVariant
bool variants1;
if (m_ie_par1.isNull())
variants1=m_cachedPar1.isNull();
@@ -686,17 +686,17 @@ void KPrPixmapObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
// Draw border
// ### TODO port to KoBorder::drawBorders() (after writing a simplified version of it, that takes the same border on each size)
- QPen pen2;
+ TQPen pen2;
if ( drawContour ) {
- pen2 = QPen( Qt::black, 1, Qt::DotLine );
- _painter->setRasterOp( Qt::NotXorROP );
+ pen2 = TQPen( TQt::black, 1, TQt::DotLine );
+ _painter->setRasterOp( TQt::NotXorROP );
}
else {
pen2 = pen;
- pen2.setWidth( _zoomHandler->zoomItX( ( pen.style() == Qt::NoPen ) ? 1.0 : (double)pen.width() ) );
+ pen2.setWidth( _zoomHandler->zoomItX( ( pen.style() == TQt::NoPen ) ? 1.0 : (double)pen.width() ) );
}
_painter->setPen( pen2 );
- _painter->setBrush( Qt::NoBrush );
+ _painter->setBrush( TQt::NoBrush );
_painter->drawRect( (int)( penw ), (int)( penw ),
(int)( _zoomHandler->zoomItX( ow ) - 2.0 * penw ),
(int)( _zoomHandler->zoomItY( oh ) - 2.0 * penw ) );
@@ -706,19 +706,19 @@ void KPrPixmapObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
KPrObject::draw( _painter, _zoomHandler, pageNum, selectionMode, drawContour );
}
-QPixmap KPrPixmapObject::getOriginalPixmap()
+TQPixmap KPrPixmapObject::getOriginalPixmap()
{
- QSize _pixSize = image.getOriginalSize();
+ TQSize _pixSize = image.getOriginalSize();
kdDebug(33001) << "KPrPixmapObject::getOriginalPixmap size= " << _pixSize << endl;
- QPixmap _pixmap = image.generatePixmap( _pixSize, true );
+ TQPixmap _pixmap = image.generatePixmap( _pixSize, true );
image.clearCache(); // Release the memoy of the picture cache
return _pixmap;
}
-QPixmap KPrPixmapObject::changePictureSettings( QPixmap _tmpPixmap )
+TQPixmap KPrPixmapObject::changePictureSettings( TQPixmap _tmpPixmap )
{
- QImage _tmpImage = _tmpPixmap.convertToImage();
+ TQImage _tmpImage = _tmpPixmap.convertToImage();
if (_tmpImage.isNull())
return _tmpPixmap;
@@ -737,7 +737,7 @@ QPixmap KPrPixmapObject::changePictureSettings( QPixmap _tmpPixmap )
_tmpImage = _tmpImage.mirror( _horizontal, _vertical );
if ( depth != 0 ) {
- QImage tmpImg = _tmpImage.convertDepth( depth );
+ TQImage tmpImg = _tmpImage.convertDepth( depth );
if ( !tmpImg.isNull() )
_tmpImage = tmpImg;
}
@@ -748,9 +748,9 @@ QPixmap KPrPixmapObject::changePictureSettings( QPixmap _tmpPixmap )
if ( grayscal ) {
if ( depth == 1 || depth == 8 ) {
for ( int i = 0; i < _tmpImage.numColors(); ++i ) {
- QRgb rgb = _tmpImage.color( i );
- int gray = qGray( rgb );
- rgb = qRgb( gray, gray, gray );
+ TQRgb rgb = _tmpImage.color( i );
+ int gray = tqGray( rgb );
+ rgb = tqRgb( gray, gray, gray );
_tmpImage.setColor( i, rgb );
}
}
@@ -763,9 +763,9 @@ QPixmap KPrPixmapObject::changePictureSettings( QPixmap _tmpPixmap )
for ( _x = 0; _x < _width; ++_x ) {
for ( _y = 0; _y < _height; ++_y ) {
if ( _tmpImage.valid( _x, _y ) ) {
- QRgb rgb = _tmpImage.pixel( _x, _y );
- int gray = qGray( rgb );
- rgb = qRgb( gray, gray, gray );
+ TQRgb rgb = _tmpImage.pixel( _x, _y );
+ int gray = tqGray( rgb );
+ rgb = tqRgb( gray, gray, gray );
_tmpImage.setPixel( _x, _y, rgb );
}
}
@@ -776,8 +776,8 @@ QPixmap KPrPixmapObject::changePictureSettings( QPixmap _tmpPixmap )
if ( bright != 0 ) {
if ( depth == 1 || depth == 8 ) {
for ( int i = 0; i < _tmpImage.numColors(); ++i ) {
- QRgb rgb = _tmpImage.color( i );
- QColor c( rgb );
+ TQRgb rgb = _tmpImage.color( i );
+ TQColor c( rgb );
if ( bright > 0 )
rgb = c.light( 100 + bright ).rgb();
@@ -796,8 +796,8 @@ QPixmap KPrPixmapObject::changePictureSettings( QPixmap _tmpPixmap )
for ( _x = 0; _x < _width; ++_x ) {
for ( _y = 0; _y < _height; ++_y ) {
if ( _tmpImage.valid( _x, _y ) ) {
- QRgb rgb = _tmpImage.pixel( _x, _y );
- QColor c( rgb );
+ TQRgb rgb = _tmpImage.pixel( _x, _y );
+ TQColor c( rgb );
if ( bright > 0 )
rgb = c.light( 100 + bright ).rgb();