diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
commit | eba47f8f0637f451e21348187591e1f1fd58ac74 (patch) | |
tree | 448f10b95c656604acc331a3236c1e59bde5c1ad /kfaxview/libkfaximage | |
parent | c7e8736c69373f48b0401319757c742e8607431a (diff) | |
download | tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.tar.gz tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.zip |
TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfaxview/libkfaximage')
-rw-r--r-- | kfaxview/libkfaximage/faxexpand.h | 10 | ||||
-rw-r--r-- | kfaxview/libkfaximage/kfaximage.cpp | 58 | ||||
-rw-r--r-- | kfaxview/libkfaximage/kfaximage.h | 44 |
3 files changed, 56 insertions, 56 deletions
diff --git a/kfaxview/libkfaximage/faxexpand.h b/kfaxview/libkfaximage/faxexpand.h index 8da4e8bc..736779bd 100644 --- a/kfaxview/libkfaximage/faxexpand.h +++ b/kfaxview/libkfaximage/faxexpand.h @@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * #include <sys/types.h> #include <unistd.h> -#include <qglobal.h> -#include <qimage.h> +#include <tqglobal.h> +#include <tqimage.h> #define t32bits Q_UINT32 #define t16bits Q_UINT16 @@ -61,15 +61,15 @@ class pagenode { /* compressed page descriptor */ struct strip *strips; /* array of strips containing fax data in file */ t16bits *data; /* in-memory copy of strip */ size_t length; /* length of data */ - QSize size; /* width & height of page in pixels */ + TQSize size; /* width & height of page in pixels */ int inverse; /* black <=> white */ int lsbfirst; /* bit order is lsb first */ int type; /* Bernd: tiff vs no tiff*/ int orient; /* orientation - upsidedown, landscape, mirrored */ int vres; /* vertical resolution: 1 = fine */ - QPoint dpi; /* DPI horz/vert */ + TQPoint dpi; /* DPI horz/vert */ void (*expander)(class pagenode *, drawfunc); - QImage image; + TQImage image; unsigned int bytes_per_line; }; diff --git a/kfaxview/libkfaximage/kfaximage.cpp b/kfaxview/libkfaximage/kfaximage.cpp index 28744923..c0efb624 100644 --- a/kfaxview/libkfaximage/kfaximage.cpp +++ b/kfaxview/libkfaximage/kfaximage.cpp @@ -24,8 +24,8 @@ #include <stdlib.h> -#include <qimage.h> -#include <qfile.h> +#include <tqimage.h> +#include <tqfile.h> #include <kglobal.h> #include <klocale.h> @@ -38,22 +38,22 @@ static const char FAXMAGIC[] = "\000PC Research, Inc\000\000\000\000\000\000"; static const char littleTIFF[] = "\x49\x49\x2a\x00"; static const char bigTIFF[] = "\x4d\x4d\x00\x2a"; -KFaxImage::KFaxImage( const QString &filename, QObject *parent, const char *name ) - : QObject(parent,name) +KFaxImage::KFaxImage( const TQString &filename, TQObject *parent, const char *name ) + : TQObject(parent,name) { - KGlobal::locale()->insertCatalogue( QString::fromLatin1("libkfaximage") ); + KGlobal::locale()->insertCatalogue( TQString::fromLatin1("libkfaximage") ); loadImage(filename); } KFaxImage::~KFaxImage() { } -bool KFaxImage::loadImage( const QString &filename ) +bool KFaxImage::loadImage( const TQString &filename ) { reset(); m_filename = filename; - m_errorString = QString::null; + m_errorString = TQString::null; if (m_filename.isEmpty()) return false; @@ -74,33 +74,33 @@ void KFaxImage::reset() // they may be needed by calling application } -QImage KFaxImage::page( unsigned int pageNr ) +TQImage KFaxImage::page( unsigned int pageNr ) { if (pageNr >= numPages()) { kdDebug() << "KFaxImage::page() called with invalid page number\n"; - return QImage(); + return TQImage(); } pagenode *pn = m_pagenodes.at(pageNr); GetImage(pn); return pn->image; } -QPoint KFaxImage::page_dpi( unsigned int pageNr ) +TQPoint KFaxImage::page_dpi( unsigned int pageNr ) { if (pageNr >= numPages()) { kdDebug() << "KFaxImage::page_dpi() called with invalid page number\n"; - return QPoint(0,0); + return TQPoint(0,0); } pagenode *pn = m_pagenodes.at(pageNr); GetImage(pn); return pn->dpi; } -QSize KFaxImage::page_size( unsigned int pageNr ) +TQSize KFaxImage::page_size( unsigned int pageNr ) { if (pageNr >= numPages()) { kdDebug() << "KFaxImage::page_size() called with invalid page number\n"; - return QSize(0,0); + return TQSize(0,0); } pagenode *pn = m_pagenodes.at(pageNr); GetImage(pn); @@ -115,7 +115,7 @@ pagenode *KFaxImage::AppendImageNode(int type) pn->type = type; pn->expander = g31expand; pn->strips = NULL; - pn->size = QSize(1728,2339); + pn->size = TQSize(1728,2339); pn->vres = -1; pn->dpi = KFAX_DPI_FINE; m_pagenodes.append(pn); @@ -125,7 +125,7 @@ pagenode *KFaxImage::AppendImageNode(int type) bool KFaxImage::NewImage(pagenode *pn, int w, int h) { - pn->image = QImage( w, h, 1, 2, QImage::systemByteOrder() ); + pn->image = TQImage( w, h, 1, 2, TQImage::systemByteOrder() ); pn->image.setColor(0, qRgb(255,255,255)); pn->image.setColor(1, qRgb(0,0,0)); pn->data = (Q_UINT16*) pn->image.bits(); @@ -137,12 +137,12 @@ bool KFaxImage::NewImage(pagenode *pn, int w, int h) void KFaxImage::FreeImage(pagenode *pn) { - pn->image = QImage(); + pn->image = TQImage(); pn->data = NULL; pn->bytes_per_line = 0; } -void KFaxImage::kfaxerror(const QString& error) +void KFaxImage::kfaxerror(const TQString& error) { m_errorString = error; kdError() << "kfaxerror: " << error << endl; @@ -155,22 +155,22 @@ KFaxImage::notefile(int type) { pagenode *newnode = new pagenode(); newnode->type = type; - newnode->size = QSize(1728,0); + newnode->size = TQSize(1728,0); return newnode; } static t32bits -get4(unsigned char *p, QImage::Endian endian) +get4(unsigned char *p, TQImage::Endian endian) { - return (endian == QImage::BigEndian) + return (endian == TQImage::BigEndian) ? (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3] : p[0]|(p[1]<<8)|(p[2]<<16)|(p[3]<<24); } static int -get2(unsigned char *p, QImage::Endian endian) +get2(unsigned char *p, TQImage::Endian endian) { - return (endian == QImage::BigEndian) ? (p[0]<<8)|p[1] : p[0]|(p[1]<<8); + return (endian == TQImage::BigEndian) ? (p[0]<<8)|p[1] : p[0]|(p[1]<<8); } /* generate pagenodes for the images in a tiff file */ @@ -179,12 +179,12 @@ KFaxImage::notetiff() { #define SC(x) (char *)(x) unsigned char header[8]; - QImage::Endian endian; + TQImage::Endian endian; t32bits IFDoff; pagenode *pn = NULL; - QString str; + TQString str; - QFile file(filename()); + TQFile file(filename()); if (!file.open(IO_ReadOnly)) { kfaxerror(i18n("Unable to open file for reading.")); return 0; @@ -195,9 +195,9 @@ KFaxImage::notetiff() return 0; } if (memcmp(header, &littleTIFF, 4) == 0) - endian = QImage::LittleEndian; + endian = TQImage::LittleEndian; else if (memcmp(header, &bigTIFF, 4) == 0) - endian = QImage::BigEndian; + endian = TQImage::BigEndian; else { maybe_RAW_FAX: kfaxerror(i18n("This is not a TIFF FAX file.")); @@ -381,7 +381,7 @@ KFaxImage::notetiff() pn->nstrips = nstrips; pn->rowsperstrip = nstrips > 1 ? rowsperstrip : iheight; pn->strips = strips; - pn->size = QSize(iwidth,iheight); + pn->size = TQSize(iwidth,iheight); pn->inverse = inverse; pn->lsbfirst = lsbfirst; pn->orient = orient; @@ -454,7 +454,7 @@ KFaxImage::getstrip(pagenode *pn, int strip) #define ShortOrder so.b[1] so.s = 1; /* XXX */ - QFile file(filename()); + TQFile file(filename()); if (!file.open(IO_ReadOnly)) { badfile(pn); return NULL; diff --git a/kfaxview/libkfaximage/kfaximage.h b/kfaxview/libkfaximage/kfaximage.h index 0ed2db90..c0d61cb6 100644 --- a/kfaxview/libkfaximage/kfaximage.h +++ b/kfaxview/libkfaximage/kfaximage.h @@ -20,10 +20,10 @@ #ifndef _LIBKFAXIMAGE_H_ #define _LIBKFAXIMAGE_H_ -#include <qobject.h> -#include <qstring.h> -#include <qimage.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqimage.h> +#include <tqptrlist.h> #include <kdelibs_export.h> class pagenode; @@ -45,9 +45,9 @@ class pagenode; * 406 dpi x 392 lpi */ -#define KFAX_DPI_STANDARD QPoint(203,98) -#define KFAX_DPI_FINE QPoint(203,196) -#define KFAX_DPI_SUPERFINE QPoint(406,392) +#define KFAX_DPI_STANDARD TQPoint(203,98) +#define KFAX_DPI_FINE TQPoint(203,196) +#define KFAX_DPI_SUPERFINE TQPoint(406,392) class KDE_EXPORT KFaxImage : public QObject @@ -63,7 +63,7 @@ public: * @see: numPages */ - KFaxImage( const QString &filename = QString::null, QObject *parent = 0, const char *name = 0 ); + KFaxImage( const TQString &filename = TQString::null, TQObject *parent = 0, const char *name = 0 ); /** * Destructor @@ -81,14 +81,14 @@ public: * @see: errorString */ - bool loadImage( const QString &filename ); + bool loadImage( const TQString &filename ); /** * returns currently loaded image file name. * @return FAX filename */ - QString filename() { return m_filename; }; + TQString filename() { return m_filename; }; /** * returns number of pages which are stored in the FAX file @@ -98,34 +98,34 @@ public: unsigned int numPages() const { return m_pagenodes.count(); }; /** - * returns a QImage which holds the contents of page pageNr + * returns a TQImage which holds the contents of page pageNr * @param pageNr: page number (starting with 0) - * @return QImage of the page pageNr + * @return TQImage of the page pageNr */ - QImage page( unsigned int pageNr ); + TQImage page( unsigned int pageNr ); /** * returns the DPI (dots per inch) of page pageNr * @param pageNr: page number (starting with 0) - * @return a QPoint value with the DPIs in X- and Y-direction + * @return a TQPoint value with the DPIs in X- and Y-direction */ - QPoint page_dpi( unsigned int pageNr ); + TQPoint page_dpi( unsigned int pageNr ); /** * returns the physical pixels of page pageNr * @param pageNr: page number (starting with 0) - * @return a QSize value with the width and height of the image + * @return a TQSize value with the width and height of the image */ - QSize page_size( unsigned int pageNr ); + TQSize page_size( unsigned int pageNr ); /** * @return a user-visible, translated error string */ - const QString errorString() const { return m_errorString; }; + const TQString errorString() const { return m_errorString; }; @@ -135,10 +135,10 @@ public: * private member variables */ - QString m_filename; - QString m_errorString; + TQString m_filename; + TQString m_errorString; - typedef QPtrList<pagenode> t_PageNodeList; + typedef TQPtrList<pagenode> t_PageNodeList; t_PageNodeList m_pagenodes; /** @@ -146,7 +146,7 @@ public: */ void reset(); - void kfaxerror(const QString& error); + void kfaxerror(const TQString& error); pagenode *AppendImageNode(int type); bool NewImage(pagenode *pn, int w, int h); void FreeImage(pagenode *pn); |