summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/KoPictureImage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kofficecore/KoPictureImage.cpp')
-rw-r--r--lib/kofficecore/KoPictureImage.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/kofficecore/KoPictureImage.cpp b/lib/kofficecore/KoPictureImage.cpp
index 021107604..c0775ac74 100644
--- a/lib/kofficecore/KoPictureImage.cpp
+++ b/lib/kofficecore/KoPictureImage.cpp
@@ -24,17 +24,17 @@
#include <kdebug.h>
#include <kmimetype.h>
-#include <qbuffer.h>
-#include <qpainter.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qapplication.h>
-#include <qdragobject.h>
+#include <tqbuffer.h>
+#include <tqpainter.h>
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqapplication.h>
+#include <tqdragobject.h>
KoPictureImage::KoPictureImage(void) : m_cacheIsInFastMode(true)
{
- // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!)
- m_cachedPixmap.setOptimization(QPixmap::MemoryOptim);
+ // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!)
+ m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim);
}
KoPictureImage::~KoPictureImage(void)
@@ -56,7 +56,7 @@ bool KoPictureImage::isNull(void) const
return m_originalImage.isNull();
}
-void KoPictureImage::scaleAndCreatePixmap(const QSize& size, bool fastMode)
+void KoPictureImage::scaleAndCreatePixmap(const TQSize& size, bool fastMode)
{
if ((size==m_cachedSize)
&& ((fastMode) || (!m_cacheIsInFastMode)))
@@ -75,27 +75,27 @@ void KoPictureImage::scaleAndCreatePixmap(const QSize& size, bool fastMode)
fastMode = true;
}
- // Use QImage::scale if we have fastMode==true
+ // Use TQImage::scale if we have fastMode==true
if ( fastMode )
{
- m_cachedPixmap.convertFromImage(m_originalImage.scale( size ), QPixmap::Color); // Always color or else B/W can be reversed
+ m_cachedPixmap.convertFromImage(m_originalImage.scale( size ), TQPixmap::Color); // Always color or else B/W can be reversed
m_cacheIsInFastMode=true;
}
else
{
- m_cachedPixmap.convertFromImage(m_originalImage.smoothScale( size ), QPixmap::Color); // Always color or else B/W can be reversed
+ m_cachedPixmap.convertFromImage(m_originalImage.smoothScale( size ), TQPixmap::Color); // Always color or else B/W can be reversed
m_cacheIsInFastMode=false;
}
m_cachedSize=size;
}
-void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode)
+void KoPictureImage::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode)
{
//kdDebug() << "KoImage::draw currentSize:" << currentSize.width() << "x" << currentSize.height() << endl;
if ( !width || !height )
return;
- QSize origSize = getOriginalSize();
- const bool scaleImage = painter.device()->isExtDev() // we are printing
+ TQSize origSize = getOriginalSize();
+ const bool scaleImage = painter.tqdevice()->isExtDev() // we are printing
&& ((width <= origSize.width()) || (height <= origSize.height()));
if( scaleImage )
{
@@ -107,14 +107,14 @@ void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height
painter.translate( x, y );
painter.scale( xScale, yScale );
// Note that sx, sy, sw and sh are unused in this case. Not a problem, since it's about printing.
- // Note 2: we do not cache the QPixmap. As we are printing, the next time we will probably
+ // Note 2: we do not cache the TQPixmap. As we are printing, the next time we will probably
// need again the screen version.
painter.drawImage(0, 0, m_originalImage);
painter.restore();
}
else
{
- QSize screenSize( width, height );
+ TQSize screenSize( width, height );
//kdDebug() << "KoPictureImage::draw screenSize=" << screenSize.width() << "x" << screenSize.height() << endl;
scaleAndCreatePixmap(screenSize, fastMode);
@@ -125,13 +125,13 @@ void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height
}
}
-bool KoPictureImage::loadData(const QByteArray& array, const QString& /* extension*/ )
+bool KoPictureImage::loadData(const TQByteArray& array, const TQString& /* extension*/ )
{
m_rawData=array;
// Second, create the original image
- QBuffer buffer(m_rawData);
+ TQBuffer buffer(m_rawData);
buffer.open(IO_ReadWrite);
- QImageIO imageIO(&buffer,NULL);
+ TQImageIO imageIO(&buffer,NULL);
if (!imageIO.read())
{
@@ -145,42 +145,42 @@ bool KoPictureImage::loadData(const QByteArray& array, const QString& /* extensi
return true;
}
-bool KoPictureImage::save(QIODevice* io) const
+bool KoPictureImage::save(TQIODevice* io) const
{
kdDebug() << k_funcinfo << "writing raw data. size=" << m_rawData.size() << endl;
// We save the raw data, to avoid damaging the file by many load/save cycles (especially for JPEG)
- Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG!
+ TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG!
return (size==m_rawData.size());
}
-QSize KoPictureImage::getOriginalSize(void) const
+TQSize KoPictureImage::getOriginalSize(void) const
{
return m_originalImage.size();
}
-QPixmap KoPictureImage::generatePixmap(const QSize& size, bool smoothScale)
+TQPixmap KoPictureImage::generatePixmap(const TQSize& size, bool smoothScale)
{
scaleAndCreatePixmap(size,!smoothScale);
return m_cachedPixmap;
}
-QString KoPictureImage::getMimeType(const QString& extension) const
+TQString KoPictureImage::getMimeType(const TQString& extension) const
{
- QString fileName("/tmp/temp.");
+ TQString fileName("/tmp/temp.");
fileName+=extension;
// Find the mimetype only by the extension, not by file content (as the file is empty!)
- const QString mimetype( KMimeType::findByPath( fileName, 0 ,true )->name() );
+ const TQString mimetype( KMimeType::findByPath( fileName, 0 ,true )->name() );
// ### TODO: use KMimeType::findByContent (but then the mimetype probably need to be cached)
kdDebug(30003) << "Image is mime type: " << mimetype << endl;
return mimetype;
}
-QDragObject* KoPictureImage::dragObject( QWidget *dragSource, const char *name )
+TQDragObject* KoPictureImage::dragObject( TQWidget *dragSource, const char *name )
{
- return new QImageDrag( m_originalImage, dragSource, name );
+ return new TQImageDrag( m_originalImage, dragSource, name );
}
-QImage KoPictureImage::generateImage(const QSize& size)
+TQImage KoPictureImage::generateImage(const TQSize& size)
{
// We do not cache the image, as we will seldom need it again.
return m_originalImage.smoothScale( size );
@@ -190,5 +190,5 @@ void KoPictureImage::clearCache(void)
{
m_cachedPixmap.resize(0, 0);
m_cacheIsInFastMode=true;
- m_cachedSize=QSize();
+ m_cachedSize=TQSize();
}