diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvilib/ext/kvi_imagelib.cpp | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvilib/ext/kvi_imagelib.cpp')
-rw-r--r-- | src/kvilib/ext/kvi_imagelib.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/kvilib/ext/kvi_imagelib.cpp b/src/kvilib/ext/kvi_imagelib.cpp index 10835b25..90b21af6 100644 --- a/src/kvilib/ext/kvi_imagelib.cpp +++ b/src/kvilib/ext/kvi_imagelib.cpp @@ -24,31 +24,31 @@ #define __KVILIB__ -#include <qnamespace.h> +#include <tqnamespace.h> #include "kvi_imagelib.h" #include "kvi_fileutils.h" #include "kvi_locale.h" #include "kvi_memmove.h" -#include <qpixmap.h> +#include <tqpixmap.h> -//KviImageLibrary::KviImageLibrary(const QPixmap &pixmap,int imageWidth,int imageHeight) +//KviImageLibrary::KviImageLibrary(const TQPixmap &pixmap,int imageWidth,int imageHeight) //{ // if(pixmap.isNull())m_pLibrary=0; -// else m_pLibrary=new QPixmap(pixmap); +// else m_pLibrary=new TQPixmap(pixmap); // setImageSize(imageWidth,imageHeight); //} -KviImageLibrary::KviImageLibrary(const QString &path,int imageWidth,int imageHeight) +KviImageLibrary::KviImageLibrary(const TQString &path,int imageWidth,int imageHeight) { m_pLibrary=0; loadLibrary(path); setImageSize(imageWidth,imageHeight); } -KviImageLibrary::KviImageLibrary(const QString &path1,const QString &path2,int imageWidth,int imageHeight) +KviImageLibrary::KviImageLibrary(const TQString &path1,const TQString &path2,int imageWidth,int imageHeight) { m_pLibrary=0; if(KviFileUtils::fileExists(path1)) @@ -78,15 +78,15 @@ bool KviImageLibrary::setImageSize(int imageWidth,int imageHeight) return true; } -bool KviImageLibrary::loadLibrary(const QString &path) +bool KviImageLibrary::loadLibrary(const TQString &path) { if(m_pLibrary)delete m_pLibrary; - m_pLibrary=new QImage(path); + m_pLibrary=new TQImage(path); if(m_pLibrary->isNull()) { delete m_pLibrary; m_pLibrary=0; - debug("WARNING : Can not load image library %s",KviQString::toUtf8(path).data()); + debug("WARNING : Can not load image library %s",KviTQString::toUtf8(path).data()); } return (m_pLibrary != 0); } @@ -99,11 +99,11 @@ int KviImageLibrary::imageCount() return ( nRows * (m_pLibrary->height()/m_iHeight)); } -QPixmap KviImageLibrary::getImage(int zeroBasedIndex) +TQPixmap KviImageLibrary::getImage(int zeroBasedIndex) { if((zeroBasedIndex >= imageCount())||(zeroBasedIndex < 0)||(m_pLibrary->depth() < 8)) { - QPixmap image(32,32); + TQPixmap image(32,32); image.fill(); //White fill return image; } @@ -114,25 +114,25 @@ QPixmap KviImageLibrary::getImage(int zeroBasedIndex) int yOffset=(zeroBasedIndex / imPerRow) * m_iHeight; #ifdef COMPILE_USE_QT4 - QImage image(m_iWidth,m_iHeight,m_pLibrary->format()); + TQImage image(m_iWidth,m_iHeight,m_pLibrary->format()); #else - QImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); + TQImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); #endif int d = image.depth() / 8; #ifndef COMPILE_USE_QT4 - if(d == 4)image.setAlphaBuffer(true); // Qt 4.x should manage it automagically + if(d == 4)image.setAlphaBuffer(true); // TQt 4.x should manage it automagically #endif //Copy the image data - //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,Qt::CopyROP,false); + //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,TQt::CopyROP,false); for(int i=0;i<m_iHeight;i++) kvi_memmove(image.scanLine(i),m_pLibrary->scanLine(i + yOffset) + (xOffset * d),m_iWidth * d); #ifdef COMPILE_USE_QT4 - QPixmap p = QPixmap::fromImage(image); + TQPixmap p = TQPixmap::fromImage(image); #else - QPixmap p(image); + TQPixmap p(image); #endif return p; } |