From bf7f88413be3831a9372d323d02fc0335b9f9188 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 26 May 2011 21:04:57 +0000 Subject: TQt4 port Gwenview This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gwenview@1233720 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/gvcore/mngformattype.cpp | 84 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'src/gvcore/mngformattype.cpp') diff --git a/src/gvcore/mngformattype.cpp b/src/gvcore/mngformattype.cpp index 60f64ef..f94f475 100644 --- a/src/gvcore/mngformattype.cpp +++ b/src/gvcore/mngformattype.cpp @@ -1,11 +1,11 @@ -// this code is copied from Qt, with fixes for not finishing decoding +// this code is copied from TQt, with fixes for not finishing decoding // prematurely /* The actual patch is: ===== --- /opt/_q/src/kernel/qmngio.cpp 2004-05-04 18:28:15.000000000 +0200 +++ gvmngformattype.cpp 2005-04-13 16:11:50.000000000 +0200 -@@ -411,8 +417,11 @@ int QMNGFormat::decode( QImage& img, QIm +@@ -411,8 +417,11 @@ int TQMNGFormat::decode( TQImage& img, TQIm } losttime += losingtimer.elapsed(); @@ -19,7 +19,7 @@ losingtimer.start(); image = 0; -@@ -422,6 +431,13 @@ int QMNGFormat::decode( QImage& img, QIm +@@ -422,6 +431,13 @@ int TQMNGFormat::decode( TQImage& img, TQIm // Move back unused tail memcpy(buffer,buffer+ubuffer,nbuffer); } @@ -39,33 +39,33 @@ /**************************************************************************** ** ** -** Implementation of MNG QImage IOHandler +** Implementation of MNG TQImage IOHandler ** ** Created : 970521 ** ** Copyright (C) 1997-2004 Trolltech AS. All rights reserved. ** -** This file is part of the kernel module of the Qt GUI Toolkit. +** This file is part of the kernel module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. +** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are @@ -75,40 +75,40 @@ #include -#ifndef QT_CLEAN_NAMESPACE -#define QT_CLEAN_NAMESPACE +#ifndef TQT_CLEAN_NAMESPACE +#define TQT_CLEAN_NAMESPACE #endif -#include "qdatetime.h" +#include "tqdatetime.h" #include "mngformattype.h" -//#ifndef QT_NO_IMAGEIO_MNG +//#ifndef TQT_NO_IMAGEIO_MNG #ifdef HAVE_LIBMNG -#include "qimage.h" -#include "qasyncimageio.h" -#include "qiodevice.h" +#include "tqimage.h" +#include "tqasyncimageio.h" +#include "tqiodevice.h" // Define XMD_H prohibits the included headers of libmng.h to typedef INT32. // This is needed for Borland with STL support, since in that case, INT32 is // already defined by some Borland header. #define XMD_H -#if defined(Q_OS_UNIXWARE) +#if defined(TQ_OS_UNIXWARE) # define HAVE_BOOLEAN // libjpeg under Unixware seems to need this #endif #include #include -#ifndef QT_NO_ASYNC_IMAGE_IO +#ifndef TQT_NO_ASYNC_IMAGE_IO namespace Gwenview { -class MNGFormat : public QImageFormat { +class MNGFormat : public TQImageFormat { public: MNGFormat(); virtual ~MNGFormat(); - int decode(QImage& img, QImageConsumer* consumer, + int decode(TQImage& img, TQImageConsumer* consumer, const uchar* buffer, int length); bool openstream() @@ -177,7 +177,7 @@ public: memset(image->bits(),0,iWidth*iHeight*4); consumer->setSize(iWidth,iHeight); mng_set_canvasstyle(handle, - QImage::systemByteOrder() == QImage::LittleEndian + TQImage::systemByteOrder() == TQImage::LittleEndian ? MNG_CANVAS_BGRA8 : MNG_CANVAS_ARGB8 ); return TRUE; } @@ -187,7 +187,7 @@ public: } mng_bool refresh( mng_uint32 x, mng_uint32 y, mng_uint32 w, mng_uint32 h ) { - QRect r(x,y,w,h); + TQRect r(x,y,w,h); consumer->changed(r); consumer->setFramePeriod(0); consumer->frameDone(); @@ -220,8 +220,8 @@ private: uint nbuffer; // Timing - QTime timer; - QTime losingtimer; + TQTime timer; + TQTime losingtimer; int losttime; void enlargeBuffer(uint n) @@ -236,25 +236,25 @@ private: const uchar* data; uint ndata; uint ubuffer; - QImageConsumer* consumer; - QImage* image; + TQImageConsumer* consumer; + TQImage* image; }; -class MNGFormatType : public QImageFormatType +class MNGFormatType : public TQImageFormatType { - QImageFormat* decoderFor(const uchar* buffer, int length); + TQImageFormat* decoderFor(const uchar* buffer, int length); const char* formatName() const; }; /* - \class QMNGFormat qmngio.h + \class TQMNGFormat qmngio.h \brief Incremental image decoder for MNG image format. \ingroup images \ingroup graphics - This subclass of QImageFormat decodes MNG format images, + This subclass of TQImageFormat decodes MNG format images, including animated MNGs. Animated MNG images are standard MNG images. The MNG standard @@ -280,20 +280,20 @@ TODO: decide on this point. gIFg gives disposal types, so it can be done. */ /* - \class QMNGFormatType qasyncimageio.h + \class TQMNGFormatType qasyncimageio.h \brief Incremental image decoder for MNG image format. \ingroup images \ingroup graphics \ingroup io - This subclass of QImageFormatType recognizes MNG - format images, creating a QMNGFormat when required. An instance + This subclass of TQImageFormatType recognizes MNG + format images, creating a TQMNGFormat when required. An instance of this class is created automatically before any other factories, so you should have no need for such objects. */ -QImageFormat* MNGFormatType::decoderFor( const uchar* buffer, int length ) +TQImageFormat* MNGFormatType::decoderFor( const uchar* buffer, int length ) { if (length < 8) return 0; @@ -313,7 +313,7 @@ QImageFormat* MNGFormatType::decoderFor( const uchar* buffer, int length ) && buffer[5]==10 && buffer[6]==26 && buffer[7]==10 -#ifdef QT_NO_IMAGEIO_PNG // if we don't have native PNG support use libmng +#ifdef TQT_NO_IMAGEIO_PNG // if we don't have native PNG support use libmng || buffer[0]==137 // PNG signature && buffer[1]=='P' && buffer[2]=='N' @@ -335,7 +335,7 @@ const char* MNGFormatType::formatName() const /*! - Constructs a QMNGFormat. + Constructs a TQMNGFormat. */ MNGFormat::MNGFormat() { @@ -348,7 +348,7 @@ MNGFormat::MNGFormat() } /* - Destroys a QMNGFormat. + Destroys a TQMNGFormat. */ MNGFormat::~MNGFormat() { @@ -425,7 +425,7 @@ static void memfree( mng_ptr iPtr, mng_size_t /*iLen*/ ) Returns the number of bytes consumed. */ -int MNGFormat::decode( QImage& img, QImageConsumer* cons, +int MNGFormat::decode( TQImage& img, TQImageConsumer* cons, const uchar* buf, int length ) { consumer = cons; @@ -486,9 +486,9 @@ int MNGFormat::decode( QImage& img, QImageConsumer* cons, static MNGFormatType* globalMngFormatTypeObject = 0; -#endif // QT_NO_ASYNC_IMAGE_IO +#endif // TQT_NO_ASYNC_IMAGE_IO -#ifndef QT_NO_ASYNC_IMAGE_IO +#ifndef TQT_NO_ASYNC_IMAGE_IO void gvCleanupMngIO() { if ( globalMngFormatTypeObject ) { @@ -503,7 +503,7 @@ void gvInitMngIO() static bool done = FALSE; if ( !done ) { done = TRUE; -#ifndef QT_NO_ASYNC_IMAGE_IO +#ifndef TQT_NO_ASYNC_IMAGE_IO globalMngFormatTypeObject = new MNGFormatType; qAddPostRoutine( gvCleanupMngIO ); #endif -- cgit v1.2.1