From eba47f8f0637f451e21348187591e1f1fd58ac74 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 2 Aug 2010 19:23:46 +0000 Subject: TQt conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdvi/TeXFont.h | 6 +- kdvi/TeXFontDefinition.cpp | 24 ++-- kdvi/TeXFontDefinition.h | 30 ++-- kdvi/TeXFont_PFB.cpp | 28 ++-- kdvi/TeXFont_PFB.h | 2 +- kdvi/TeXFont_PK.cpp | 28 ++-- kdvi/TeXFont_PK.h | 2 +- kdvi/TeXFont_TFM.cpp | 10 +- kdvi/TeXFont_TFM.h | 2 +- kdvi/bigEndianByteReader.h | 2 +- kdvi/dviFile.cpp | 34 ++--- kdvi/dviFile.h | 36 ++--- kdvi/dviRenderer.cpp | 158 ++++++++++----------- kdvi/dviRenderer.h | 102 +++++++------- kdvi/dviRenderer_draw.cpp | 20 +-- kdvi/dviRenderer_export.cpp | 84 +++++------ kdvi/dviRenderer_prescan.cpp | 124 ++++++++--------- kdvi/dviWidget.cpp | 10 +- kdvi/dviWidget.h | 14 +- kdvi/dvisourcesplitter.cpp | 14 +- kdvi/dvisourcesplitter.h | 12 +- kdvi/fontEncoding.cpp | 24 ++-- kdvi/fontEncoding.h | 8 +- kdvi/fontEncodingPool.cpp | 2 +- kdvi/fontEncodingPool.h | 8 +- kdvi/fontMap.cpp | 48 +++---- kdvi/fontMap.h | 26 ++-- kdvi/fontpool.cpp | 100 ++++++------- kdvi/fontpool.h | 32 ++--- kdvi/fontprogress.cpp | 46 +++--- kdvi/fontprogress.h | 16 +-- kdvi/glyph.h | 8 +- kdvi/infodialog.cpp | 84 +++++------ kdvi/infodialog.h | 22 +-- kdvi/kdvi_multipage.cpp | 58 ++++---- kdvi/kdvi_multipage.h | 8 +- kdvi/kdvi_multipage_texthandling.cpp | 4 +- kdvi/kprinterwrapper.h | 2 +- kdvi/main.cpp | 24 ++-- kdvi/optionDialogFontsWidget.cpp | 14 +- kdvi/optionDialogFontsWidget.h | 2 +- kdvi/optionDialogSpecialWidget.cpp | 20 +-- kdvi/optionDialogSpecialWidget.h | 12 +- kdvi/performanceMeasurement.h | 4 +- kdvi/prebookmark.h | 10 +- kdvi/psgs.cpp | 70 +++++----- kdvi/psgs.h | 46 +++--- kdvi/renderedDviPagePixmap.h | 4 +- kdvi/special.cpp | 262 +++++++++++++++++------------------ kdvi/util.cpp | 2 +- kdvi/vf.cpp | 2 +- 51 files changed, 855 insertions(+), 855 deletions(-) (limited to 'kdvi') diff --git a/kdvi/TeXFont.h b/kdvi/TeXFont.h index 8ff70499..d3ee51af 100644 --- a/kdvi/TeXFont.h +++ b/kdvi/TeXFont.h @@ -18,7 +18,7 @@ class TeXFont { TeXFont(TeXFontDefinition *_parent) { parent = _parent; - errorMessage = QString::null; + errorMessage = TQString::null; }; virtual ~TeXFont(); @@ -29,7 +29,7 @@ class TeXFont { glyphtable[i].shrunkenCharacter.resize(0, 0); }; - virtual glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const QColor& color=Qt::black) = 0; + virtual glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=Qt::black) = 0; // Checksum of the font. Used e.g. by PK fonts. This field is filled // in by the constructor, or set to 0.0, if the font format does not @@ -38,7 +38,7 @@ class TeXFont { // If the font or if some glyphs could not be loaded, error messages // will be put here. - QString errorMessage; + TQString errorMessage; protected: glyph glyphtable[TeXFontDefinition::max_num_of_chars_in_font]; diff --git a/kdvi/TeXFontDefinition.cpp b/kdvi/TeXFontDefinition.cpp index 9b745c83..03dd1b72 100644 --- a/kdvi/TeXFontDefinition.cpp +++ b/kdvi/TeXFontDefinition.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include "dviRenderer.h" #include "fontpool.h" @@ -31,7 +31,7 @@ extern const int MFResolutions[]; // #define DEBUG_FONT -TeXFontDefinition::TeXFontDefinition(QString nfontname, double _displayResolution_in_dpi, Q_UINT32 chk, Q_INT32 _scaled_size_in_DVI_units, +TeXFontDefinition::TeXFontDefinition(TQString nfontname, double _displayResolution_in_dpi, Q_UINT32 chk, Q_INT32 _scaled_size_in_DVI_units, class fontPool *pool, double _enlargement) { #ifdef DEBUG_FONT @@ -46,7 +46,7 @@ TeXFontDefinition::TeXFontDefinition(QString nfontname, double _displayResolutio checksum = chk; flags = TeXFontDefinition::FONT_IN_USE; file = 0; - filename = QString::null; + filename = TQString::null; scaled_size_in_DVI_units = _scaled_size_in_DVI_units; macrotable = 0; @@ -84,7 +84,7 @@ TeXFontDefinition::~TeXFontDefinition() } -void TeXFontDefinition::fontNameReceiver(const QString& fname) +void TeXFontDefinition::fontNameReceiver(const TQString& fname) { #ifdef DEBUG_FONT kdDebug(4300) << "void TeXFontDefinition::fontNameReceiver( " << fname << " )" << endl; @@ -93,17 +93,17 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname) flags |= TeXFontDefinition::FONT_LOADED; filename = fname; #ifdef HAVE_FREETYPE - fullFontName = QString::null; - fullEncodingName = QString::null; + fullFontName = TQString::null; + fullEncodingName = TQString::null; #endif - file = fopen(QFile::encodeName(filename), "r"); + file = fopen(TQFile::encodeName(filename), "r"); // Check if the file could be opened. If not, try to find the file // in the DVI file's directory. If that works, modify the filename // accordingly and go on. if (file == 0) { - QString filename_test(font_pool->getExtraSearchPath() + "/" + filename); - file = fopen( QFile::encodeName(filename_test), "r"); + TQString filename_test(font_pool->getExtraSearchPath() + "/" + filename); + file = fopen( TQFile::encodeName(filename_test), "r"); if (file == 0) { kdError(4300) << i18n("Cannot find font %1, file %2.").arg(fontname).arg(filename) << endl; return; @@ -149,7 +149,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname) file = 0; #ifdef HAVE_FREETYPE // Find the encoding for that font - const QString &enc = font_pool->fontsByTeXName.findEncoding(fontname); + const TQString &enc = font_pool->fontsByTeXName.findEncoding(fontname); if (enc.isEmpty() == false) { #ifdef DEBUG_FONT @@ -195,7 +195,7 @@ void TeXFontDefinition::reset() vf_table.clear(); } - filename = QString::null; + filename = TQString::null; flags = TeXFontDefinition::FONT_IN_USE; set_char_p = &dviRenderer::set_empty_char; } @@ -225,7 +225,7 @@ void TeXFontDefinition::mark_as_used() // For virtual fonts, also go through the list of referred fonts if (flags & TeXFontDefinition::FONT_VIRTUAL) { - QIntDictIterator it(vf_table); + TQIntDictIterator it(vf_table); while( it.current() ) { it.current()->mark_as_used(); ++it; diff --git a/kdvi/TeXFontDefinition.h b/kdvi/TeXFontDefinition.h index e3effc2a..d64e6d59 100644 --- a/kdvi/TeXFontDefinition.h +++ b/kdvi/TeXFontDefinition.h @@ -15,8 +15,8 @@ #ifndef _FONT_H #define _FONT_H -#include -#include +#include +#include #include @@ -56,12 +56,12 @@ class TeXFontDefinition { }; - TeXFontDefinition(QString nfontname, double _displayResolution_in_dpi, Q_UINT32 chk, Q_INT32 _scaled_size_in_DVI_units, + TeXFontDefinition(TQString nfontname, double _displayResolution_in_dpi, Q_UINT32 chk, Q_INT32 _scaled_size_in_DVI_units, class fontPool *pool, double _enlargement); ~TeXFontDefinition(); void reset(); - void fontNameReceiver(const QString&); + void fontNameReceiver(const TQString&); // Members for character fonts void setDisplayResolution(double _displayResolution_in_dpi); @@ -71,7 +71,7 @@ class TeXFontDefinition { void mark_as_used(); class fontPool *font_pool; // Pointer to the pool that contains this font. - QString fontname; // name of font, such as "cmr10" + TQString fontname; // name of font, such as "cmr10" unsigned char flags; // flags byte (see values below) double enlargement; Q_INT32 scaled_size_in_DVI_units; // Scaled size from the font definition command; in DVI units @@ -82,34 +82,34 @@ class TeXFontDefinition { double displayResolution_in_dpi; FILE *file; // open font file or NULL - QString filename; // name of font file + TQString filename; // name of font file TeXFont *font; macro *macrotable; // used by (loaded) virtual fonts - QIntDict vf_table; // used by (loaded) virtual fonts, list of fonts used by this vf, + TQIntDict vf_table; // used by (loaded) virtual fonts, list of fonts used by this vf, // acessible by number TeXFontDefinition *first_font; // used by (loaded) virtual fonts, list of fonts used by this vf #ifdef HAVE_FREETYPE - const QString &getFullFontName() const {return fullFontName;} - const QString &getFullEncodingName() const {return fullEncodingName;} + const TQString &getFullFontName() const {return fullFontName;} + const TQString &getFullEncodingName() const {return fullEncodingName;} #endif - const QString &getFontTypeName() const {return fontTypeName;} + const TQString &getFontTypeName() const {return fontTypeName;} #ifdef HAVE_FREETYPE /** For FREETYPE fonts, which use a map file, this field will contain the full name of the font (e.g. 'Computer Modern'). If the name does not exist, or cannot be found, this field will be - QString::null. Only subclasses of TeXFont should write into this + TQString::null. Only subclasses of TeXFont should write into this field. */ - QString fullFontName; + TQString fullFontName; /** For FREETYPE fonts, which use a map file, this field will contain the full name of the font encoding (e.g. 'TexBase1'). If the encoding name does not exist, or cannot be found, this field - will be QString::null. Only subclasses of TeXFont should write + will be TQString::null. Only subclasses of TeXFont should write into this field. */ - QString fullEncodingName; + TQString fullEncodingName; #endif private: @@ -117,7 +117,7 @@ class TeXFontDefinition { /** This will be set to a human-readable description of the font, e.g. "virtual" or "TeX PK", or "Type 1" */ - QString fontTypeName; + TQString fontTypeName; // Functions related to virtual fonts void read_VF_index(void ); diff --git a/kdvi/TeXFont_PFB.cpp b/kdvi/TeXFont_PFB.cpp index 927c84bc..2b3883fe 100644 --- a/kdvi/TeXFont_PFB.cpp +++ b/kdvi/TeXFont_PFB.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include "fontpool.h" @@ -74,8 +74,8 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl // TeX is only able to address character codes 0-255 while // e.g. Type1 fonts may contain several thousands of characters) if (enc != 0) { - parent->fullEncodingName = enc->encodingFullName.remove(QString::fromLatin1( "Encoding" )); - parent->fullEncodingName = enc->encodingFullName.remove(QString::fromLatin1( "encoding" )); + parent->fullEncodingName = enc->encodingFullName.remove(TQString::fromLatin1( "Encoding" )); + parent->fullEncodingName = enc->encodingFullName.remove(TQString::fromLatin1( "encoding" )); // An encoding vector is given for this font, i.e. an array of // character names (such as: 'parenleft' or 'dotlessj'). We use @@ -138,7 +138,7 @@ TeXFont_PFB::~TeXFont_PFB() } -glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QColor& color) +glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQColor& color) { #ifdef DEBUG_PFB kdDebug(4300) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl; @@ -168,12 +168,12 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QC long int characterSize_in_printers_points_by_64 = (long int)((64.0*72.0*parent->scaled_size_in_DVI_units*parent->font_pool->getCMperDVIunit())/2.54 + 0.5 ); error = FT_Set_Char_Size(face, 0, characterSize_in_printers_points_by_64, res, res ); if (error) { - QString msg = i18n("FreeType reported an error when setting the character size for font file %1.").arg(parent->filename); + TQString msg = i18n("FreeType reported an error when setting the character size for font file %1.").arg(parent->filename); if (errorMessage.isEmpty()) errorMessage = msg; kdError(4300) << msg << endl; g->shrunkenCharacter.resize(1,1); - g->shrunkenCharacter.fill(QColor(255, 255, 255)); + g->shrunkenCharacter.fill(TQColor(255, 255, 255)); return g; } @@ -184,24 +184,24 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QC error = FT_Load_Glyph(face, charMap[ch], FT_LOAD_NO_HINTING ); if (error) { - QString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.").arg(ch).arg(parent->filename); + TQString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.").arg(ch).arg(parent->filename); if (errorMessage.isEmpty()) errorMessage = msg; kdError(4300) << msg << endl; g->shrunkenCharacter.resize(1,1); - g->shrunkenCharacter.fill(QColor(255, 255, 255)); + g->shrunkenCharacter.fill(TQColor(255, 255, 255)); return g; } // convert to an anti-aliased bitmap error = FT_Render_Glyph( face->glyph, ft_render_mode_normal ); if (error) { - QString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.").arg(ch).arg(parent->filename); + TQString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.").arg(ch).arg(parent->filename); if (errorMessage.isEmpty()) errorMessage = msg; kdError(4300) << msg << endl; g->shrunkenCharacter.resize(1,1); - g->shrunkenCharacter.fill(QColor(255, 255, 255)); + g->shrunkenCharacter.fill(TQColor(255, 255, 255)); return g; } @@ -212,11 +212,11 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QC errorMessage = i18n("Glyph #%1 is empty.").arg(ch); kdError(4300) << i18n("Glyph #%1 from font file %2 is empty.").arg(ch).arg(parent->filename) << endl; g->shrunkenCharacter.resize( 15, 15 ); - g->shrunkenCharacter.fill(QColor(255, 0, 0)); + g->shrunkenCharacter.fill(TQColor(255, 0, 0)); g->x2 = 0; g->y2 = 15; } else { - QImage imgi(slot->bitmap.width, slot->bitmap.rows, 32); + TQImage imgi(slot->bitmap.width, slot->bitmap.rows, 32); imgi.setAlphaBuffer(true); // Do QPixmaps fully support the alpha channel? If yes, we use @@ -240,7 +240,7 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QC } else { // If the alpha channel is not supported... QT seems to turn // the alpha channel into a crude bitmap which is used to mask - // the resulting QPixmap. In this case, we define the + // the resulting TQPixmap. In this case, we define the // character outline using the image data, and use the alpha // channel only to store "maximally opaque" or "completely // transparent" values. When characters are rendered, @@ -279,7 +279,7 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QC if (g->dvi_advance_in_units_of_design_size_by_2e20 == 0) { int error = FT_Load_Glyph(face, charMap[ch], FT_LOAD_NO_SCALE); if (error) { - QString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.").arg(ch).arg(parent->filename); + TQString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.").arg(ch).arg(parent->filename); if (errorMessage.isEmpty()) errorMessage = msg; kdError(4300) << msg << endl; diff --git a/kdvi/TeXFont_PFB.h b/kdvi/TeXFont_PFB.h index 68211cdb..4e2d8122 100644 --- a/kdvi/TeXFont_PFB.h +++ b/kdvi/TeXFont_PFB.h @@ -26,7 +26,7 @@ class TeXFont_PFB : public TeXFont { TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc=0, double slant=0.0 ); ~TeXFont_PFB(); - glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const QColor& color=Qt::black); + glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=Qt::black); private: FT_Face face; diff --git a/kdvi/TeXFont_PK.cpp b/kdvi/TeXFont_PK.cpp index 6a3c9b3a..7e1ce60d 100644 --- a/kdvi/TeXFont_PK.cpp +++ b/kdvi/TeXFont_PK.cpp @@ -54,10 +54,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -76,7 +76,7 @@ #define PK_MAGIC (PK_PRE << 8) + PK_ID -extern void oops(QString message); +extern void oops(TQString message); @@ -89,7 +89,7 @@ TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent) for(unsigned int i=0; ifilename), "r"); + file = fopen(TQFile::encodeName(parent->filename), "r"); if (file == 0) kdError(4300) << i18n("Cannot open font file %1.").arg(parent->filename) << endl; #ifdef DEBUG_PK @@ -116,7 +116,7 @@ TeXFont_PK::~TeXFont_PK() } -glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QColor& color) +glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQColor& color) { #ifdef DEBUG_PK kdDebug(4300) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl; @@ -158,7 +158,7 @@ glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QCo } // At this point, g points to a properly loaded character. Generate - // a smoothly scaled QPixmap if the user asks for it. + // a smoothly scaled TQPixmap if the user asks for it. if ((generateCharacterPixmap == true) && ((g->shrunkenCharacter.isNull()) || (color != g->color)) && (characterBitmaps[ch]->w != 0)) { @@ -208,7 +208,7 @@ glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QCo int shrunk_height = (int)ceil( (characterBitmaps[ch]->h - srcYTrans)/shrinkFactor ); // Turn the image into 8 bit - QByteArray translated(characterBitmaps[ch]->w * characterBitmaps[ch]->h); + TQByteArray translated(characterBitmaps[ch]->w * characterBitmaps[ch]->h); Q_UINT8 *data = (Q_UINT8 *)translated.data(); for(int x=0; xw; x++) for(int y=0; yh; y++) { @@ -219,7 +219,7 @@ glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QCo } // Now shrink the image. We shrink the X-direction first - QByteArray xshrunk(shrunk_width*characterBitmaps[ch]->h); + TQByteArray xshrunk(shrunk_width*characterBitmaps[ch]->h); Q_UINT8 *xdata = (Q_UINT8 *)xshrunk.data(); // Do the shrinking. The pixel (x,y) that we want to calculate @@ -247,7 +247,7 @@ glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const QCo } // Now shrink the Y-direction - QByteArray xyshrunk(shrunk_width*shrunk_height); + TQByteArray xyshrunk(shrunk_width*shrunk_height); Q_UINT8 *xydata = (Q_UINT8 *)xyshrunk.data(); for(int x=0; xshrunkenCharacter.convertFromImage(im32,0); - g->shrunkenCharacter.setOptimization(QPixmap::BestOptim); + g->shrunkenCharacter.setOptimization(TQPixmap::BestOptim); } return g; } diff --git a/kdvi/TeXFont_PK.h b/kdvi/TeXFont_PK.h index b555934e..80a0c0e1 100644 --- a/kdvi/TeXFont_PK.h +++ b/kdvi/TeXFont_PK.h @@ -12,7 +12,7 @@ class TeXFont_PK : public TeXFont { TeXFont_PK(TeXFontDefinition *parent); ~TeXFont_PK(); - glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const QColor& color=Qt::black); + glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=Qt::black); private: FILE *file; // open font file or NULL diff --git a/kdvi/TeXFont_TFM.cpp b/kdvi/TeXFont_TFM.cpp index 54edd2fc..c8268f01 100644 --- a/kdvi/TeXFont_TFM.cpp +++ b/kdvi/TeXFont_TFM.cpp @@ -11,8 +11,8 @@ #include #include -#include -#include +#include +#include #include "glyph.h" #include "TeXFont_TFM.h" @@ -28,12 +28,12 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent) kdDebug(4300) << "TeXFont_TFM::TeXFont_TFM( parent=" << parent << " )" << endl; #endif - QFile file( parent->filename ); + TQFile file( parent->filename ); if ( !file.open( IO_ReadOnly ) ) { kdError(4300) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file" << endl; return; } - QDataStream stream( &file ); + TQDataStream stream( &file ); // Data from the very beginning of the TFM file, as specified in // "The DVI Driver Standard, Level 0", section D.2.1 @@ -122,7 +122,7 @@ TeXFont_TFM::~TeXFont_TFM() } -glyph *TeXFont_TFM::getGlyph(Q_UINT16 characterCode, bool generateCharacterPixmap, const QColor& color) +glyph *TeXFont_TFM::getGlyph(Q_UINT16 characterCode, bool generateCharacterPixmap, const TQColor& color) { #ifdef DEBUG_TFM kdDebug(4300) << "TeXFont_TFM::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl; diff --git a/kdvi/TeXFont_TFM.h b/kdvi/TeXFont_TFM.h index e68ba872..737c8bed 100644 --- a/kdvi/TeXFont_TFM.h +++ b/kdvi/TeXFont_TFM.h @@ -26,7 +26,7 @@ class TeXFont_TFM : public TeXFont { TeXFont_TFM(TeXFontDefinition *parent); ~TeXFont_TFM(); - glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const QColor& color=Qt::black); + glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=Qt::black); private: fix_word characterWidth_in_units_of_design_size[256]; diff --git a/kdvi/bigEndianByteReader.h b/kdvi/bigEndianByteReader.h index 674ca1c1..06ef1b13 100644 --- a/kdvi/bigEndianByteReader.h +++ b/kdvi/bigEndianByteReader.h @@ -18,7 +18,7 @@ #ifndef _bigEndianByteReader_H #define _bigEndianByteReader_H -#include +#include class bigEndianByteReader { public: diff --git a/kdvi/dviFile.cpp b/kdvi/dviFile.cpp index 521fb39f..336507db 100644 --- a/kdvi/dviFile.cpp +++ b/kdvi/dviFile.cpp @@ -54,8 +54,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -71,7 +71,7 @@ extern "C" { dvifile::dvifile(const dvifile *old, fontPool *fp) { - errorMsg = QString::null; + errorMsg = TQString::null; errorCounter = 0; page_offset = 0; suggestedPageSize = 0; @@ -267,13 +267,13 @@ void dvifile::prepare_pages() } -dvifile::dvifile(const QString& fname, fontPool* pool) +dvifile::dvifile(const TQString& fname, fontPool* pool) { #ifdef DEBUG_DVIFILE kdDebug(4300) << "init_dvi_file: " << fname << endl; #endif - errorMsg = QString::null; + errorMsg = TQString::null; errorCounter = 0; page_offset = 0; suggestedPageSize = 0; @@ -282,7 +282,7 @@ dvifile::dvifile(const QString& fname, fontPool* pool) font_pool = pool; sourceSpecialMarker = true; - QFile file(fname); + TQFile file(fname); filename = file.name(); file.open( IO_ReadOnly ); size_of_file = file.size(); @@ -319,9 +319,9 @@ dvifile::~dvifile() #endif // Delete converted PDF files - QMap::Iterator it; + TQMap::Iterator it; for ( it = convertedFiles.begin(); it != convertedFiles.end(); ++it ) - QFile::remove(it.data()); + TQFile::remove(it.data()); if (suggestedPageSize != 0) delete suggestedPageSize; @@ -359,18 +359,18 @@ void dvifile::renumber() } -QString dvifile::convertPDFtoPS(const QString &PDFFilename) +TQString dvifile::convertPDFtoPS(const TQString &PDFFilename) { // Check if the PDFFile is known - QMap::Iterator it = convertedFiles.find(PDFFilename); + TQMap::Iterator it = convertedFiles.find(PDFFilename); if (it != convertedFiles.end()) { // PDF-File is known. Good. return it.data(); } // Get the name of a temporary file - KTempFile tmpfile(QString::null, ".ps"); - QString convertedFileName = tmpfile.name(); + KTempFile tmpfile(TQString::null, ".ps"); + TQString convertedFileName = tmpfile.name(); tmpfile.close(); tmpfile.unlink(); @@ -378,9 +378,9 @@ QString dvifile::convertPDFtoPS(const QString &PDFFilename) KProcIO proc; proc << "pdf2ps" << PDFFilename << convertedFileName; if (proc.start(KProcess::Block) == false) - convertedFileName = QString::null; // Indicates that conversion failed, won't try again. - if (!QFile::exists(convertedFileName)) - convertedFileName = QString::null; // Indicates that conversion failed, won't try again. + convertedFileName = TQString::null; // Indicates that conversion failed, won't try again. + if (!TQFile::exists(convertedFileName)) + convertedFileName = TQString::null; // Indicates that conversion failed, won't try again. // Save name of converted file to buffer, so PDF file won't be // converted again, and files can be deleted when *this is @@ -391,12 +391,12 @@ QString dvifile::convertPDFtoPS(const QString &PDFFilename) } -bool dvifile::saveAs(const QString &filename) +bool dvifile::saveAs(const TQString &filename) { if (dvi_Data() == 0) return false; - QFile out(filename); + TQFile out(filename); if (out.open( IO_Raw|IO_WriteOnly ) == false) return false; if (out.writeBlock ( (char *)(dvi_Data()), size_of_file ) == -1) diff --git a/kdvi/dviFile.h b/kdvi/dviFile.h index 069ae6d9..59ffe65c 100644 --- a/kdvi/dviFile.h +++ b/kdvi/dviFile.h @@ -13,10 +13,10 @@ #include "bigEndianByteReader.h" -#include -#include -#include -#include +#include +#include +#include +#include class fontPool; class pageSize; @@ -28,25 +28,25 @@ class dvifile : public bigEndianByteReader public: /** Makes a deep copy of the old DVI file. */ dvifile(const dvifile *old, fontPool *fp ); - dvifile(const QString& fname, class fontPool* pool); + dvifile(const TQString& fname, class fontPool* pool); ~dvifile(); fontPool * font_pool; - QString filename; - QString generatorString; + TQString filename; + TQString generatorString; Q_UINT16 total_pages; - QMemArray page_offset; + TQMemArray page_offset; /** Saves the DVI file. Returns true on success. */ - bool saveAs(const QString &filename); + bool saveAs(const TQString &filename); // Returns a pointer to the DVI file's data, or 0 if no data has yet // been allocated. Q_UINT8 * dvi_Data() {return dviData.data();} - QIODevice::Offset size_of_file; - QString errorMsg; + TQIODevice::Offset size_of_file; + TQString errorMsg; /** This field is set to zero when the DVI file is constructed, and will be modified during the prescan phase (at this time the @@ -68,7 +68,7 @@ class dvifile : public bigEndianByteReader KDVI ensures that the user is only informed once. */ bool sourceSpecialMarker; - QIntDict tn_table; + TQIntDict tn_table; /** Returns the number of centimeters per DVI unit in this DVI file. */ @@ -89,7 +89,7 @@ class dvifile : public bigEndianByteReader /** Sets new DVI data; all old data is erased. EXPERIMENTAL, use with care. */ - void setNewData(const QMemArray& newData) {dviData = newData;} + void setNewData(const TQMemArray& newData) {dviData = newData;} /** Page numbers that appear in a DVI document need not be ordered. Worse, page numbers need not be unique. This method @@ -112,9 +112,9 @@ class dvifile : public bigEndianByteReader name, the method will then NOT convert the file, but simply return the name from the buffer - @returns The name of the PS file, or QString::null on failure. + @returns The name of the PS file, or TQString::null on failure. */ - QString convertPDFtoPS(const QString &PDFFilename); + TQString convertPDFtoPS(const TQString &PDFFilename); private: /** process_preamble reads the information in the preamble and @@ -134,17 +134,17 @@ class dvifile : public bigEndianByteReader double cmPerDVIunit; - QMemArray dviData; + TQMemArray dviData; /** Map of filenames for converted PDF files This map contains names of PDF files that were converted to PostScript. The key is the name of the PDF file, the data the name - of the associated PS file, or QString::null, if the file could not + of the associated PS file, or TQString::null, if the file could not be converted. The PS files are deleted when the DVI-file is destructed. */ - QMap convertedFiles; + TQMap convertedFiles; }; #endif //ifndef _DVIFILE_H diff --git a/kdvi/dviRenderer.cpp b/kdvi/dviRenderer.cpp index b9bf6256..2e0b0512 100644 --- a/kdvi/dviRenderer.cpp +++ b/kdvi/dviRenderer.cpp @@ -14,19 +14,19 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -62,12 +62,12 @@ //#define DEBUG_DVIRENDERER -QPainter *foreGroundPainter; // QPainter used for text +TQPainter *foreGroundPainter; // TQPainter used for text //------ now comes the dviRenderer class implementation ---------- -dviRenderer::dviRenderer(QWidget *par) +dviRenderer::dviRenderer(TQWidget *par) : DocumentRenderer(par), info(new infoDialog(par)) { #ifdef DEBUG_DVIRENDERER @@ -77,14 +77,14 @@ dviRenderer::dviRenderer(QWidget *par) // initialize the dvi machinery dviFile = 0; - connect(&font_pool, SIGNAL( setStatusBarText( const QString& ) ), this, SIGNAL( setStatusBarText( const QString& ) ) ); + connect(&font_pool, TQT_SIGNAL( setStatusBarText( const TQString& ) ), this, TQT_SIGNAL( setStatusBarText( const TQString& ) ) ); parentWidget = par; shrinkfactor = 3; current_page = 0; resolutionInDPI = 0.0; - connect( &clearStatusBarTimer, SIGNAL(timeout()), this, SLOT(clearStatusBar()) ); + connect( &clearStatusBarTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(clearStatusBar()) ); currentlyDrawnPage = 0; editorCommand = ""; @@ -103,7 +103,7 @@ dviRenderer::dviRenderer(QWidget *par) PS_interface = new ghostscript_interface(); // pass status bar messages through - connect(PS_interface, SIGNAL( setStatusBarText( const QString& ) ), this, SIGNAL( setStatusBarText( const QString& ) ) ); + connect(PS_interface, TQT_SIGNAL( setStatusBarText( const TQString& ) ), this, TQT_SIGNAL( setStatusBarText( const TQString& ) ) ); } @@ -125,9 +125,9 @@ dviRenderer::~dviRenderer() } -void dviRenderer::setPrefs(bool flag_showPS, const QString &str_editorCommand, bool useFontHints ) +void dviRenderer::setPrefs(bool flag_showPS, const TQString &str_editorCommand, bool useFontHints ) { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); _postscript = flag_showPS; editorCommand = str_editorCommand; font_pool.setParameters( useFontHints ); @@ -195,14 +195,14 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page) colorStack.clear(); globalColor = Qt::black; - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); foreGroundPainter = page->getPainter(); if (foreGroundPainter != 0) { - errorMsg = QString::null; + errorMsg = TQString::null; draw_page(); page->returnPainter(foreGroundPainter); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); page->isEmpty = false; if (errorMsg.isEmpty() != true) { @@ -210,7 +210,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page) i18n("File corruption! KDVI had trouble interpreting your DVI file. Most " "likely this means that the DVI file is broken."), errorMsg, i18n("DVI File Error")); - errorMsg = QString::null; + errorMsg = TQString::null; currentlyDrawnPage = 0; mutex.unlock(); return; @@ -225,7 +225,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page) dviFile->sourceSpecialMarker = false; // Show the dialog as soon as event processing is finished, and // the program is idle - QTimer::singleShot( 0, this, SLOT(showThatSourceInformationIsPresent()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(showThatSourceInformationIsPresent()) ); } } @@ -262,27 +262,27 @@ void dviRenderer::showThatSourceInformationIsPresent() KDialogBase *dialog= new KDialogBase(i18n("KDVI: Information"), KDialogBase::Yes, KDialogBase::Yes, KDialogBase::Yes, parentWidget, "information", true, true,KStdGuiItem::ok() ); - QVBox *topcontents = new QVBox (dialog); + TQVBox *topcontents = new TQVBox (dialog); topcontents->setSpacing(KDialog::spacingHint()*2); topcontents->setMargin(KDialog::marginHint()*2); - QWidget *contents = new QWidget(topcontents); - QHBoxLayout * lay = new QHBoxLayout(contents); + TQWidget *contents = new TQWidget(topcontents); + TQHBoxLayout * lay = new TQHBoxLayout(contents); lay->setSpacing(KDialog::spacingHint()*2); lay->addStretch(1); - QLabel *label1 = new QLabel( contents); - label1->setPixmap(QMessageBox::standardIcon(QMessageBox::Information)); + TQLabel *label1 = new TQLabel( contents); + label1->setPixmap(TQMessageBox::standardIcon(TQMessageBox::Information)); lay->add( label1 ); - QLabel *label2 = new QLabel( i18n("This DVI file contains source file information. You may click into the text with the " + TQLabel *label2 = new TQLabel( i18n("This DVI file contains source file information. You may click into the text with the " "middle mouse button, and an editor will open the TeX-source file immediately."), contents); label2->setMinimumSize(label2->sizeHint()); lay->add( label2 ); lay->addStretch(1); - QSize extraSize = QSize(50,30); - QCheckBox *checkbox = new QCheckBox(i18n("Do not show this message again"), topcontents); - extraSize = QSize(50,0); + TQSize extraSize = TQSize(50,30); + TQCheckBox *checkbox = new TQCheckBox(i18n("Do not show this message again"), topcontents); + extraSize = TQSize(50,0); dialog->setHelpLinkText(i18n("Explain in more detail...")); dialog->setHelp("inverse-search", "kdvi"); dialog->enableLinkedHelp(true); @@ -312,7 +312,7 @@ void dviRenderer::embedPostScript() return; embedPS_progress = new KProgressDialog(parentWidget, "embedPSProgressDialog", - i18n("Embedding PostScript Files"), QString::null, true); + i18n("Embedding PostScript Files"), TQString::null, true); if (!embedPS_progress) return; embedPS_progress->setAllowCancel(false); @@ -324,7 +324,7 @@ void dviRenderer::embedPostScript() Q_UINT16 currPageSav = current_page; - errorMsg = QString::null; + errorMsg = TQString::null; for(current_page=0; current_page < dviFile->total_pages; current_page++) { if (current_page < dviFile->total_pages) { command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page]; @@ -343,22 +343,22 @@ void dviRenderer::embedPostScript() if (!errorMsg.isEmpty()) { errorMsg = "" + errorMsg + ""; KMessageBox::detailedError(parentWidget, "" + i18n("Not all PostScript files could be embedded into your document.") + "", errorMsg); - errorMsg = QString::null; + errorMsg = TQString::null; } else KMessageBox::information(parentWidget, "" + i18n("All external PostScript files were embedded into your document. You " "will probably want to save the DVI file now.") + "", - QString::null, "embeddingDone"); + TQString::null, "embeddingDone"); // Prescan phase starts here #ifdef PERFORMANCE_MEASUREMENT kdDebug(4300) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl; - QTime preScanTimer; + TQTime preScanTimer; preScanTimer.start(); #endif dviFile->numberOfExternalPSFiles = 0; prebookmarks.clear(); for(current_page=0; current_page < dviFile->total_pages; current_page++) { - PostScriptOutPutString = new QString(); + PostScriptOutPutString = new TQString(); if (current_page < dviFile->total_pages) { command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page]; @@ -387,9 +387,9 @@ void dviRenderer::embedPostScript() } -bool dviRenderer::isValidFile(const QString& filename) const +bool dviRenderer::isValidFile(const TQString& filename) const { - QFile f(filename); + TQFile f(filename); if (!f.open(IO_ReadOnly)) return false; @@ -411,16 +411,16 @@ bool dviRenderer::isValidFile(const QString& filename) const } -bool dviRenderer::setFile(const QString &fname, const KURL &base) +bool dviRenderer::setFile(const TQString &fname, const KURL &base) { #ifdef DEBUG_DVIRENDERER kdDebug(4300) << "dviRenderer::setFile( fname='" << fname << "', ref='" << ref << "', sourceMarker=" << sourceMarker << " )" << endl; #endif - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); - QFileInfo fi(fname); - QString filename = fi.absFilePath(); + TQFileInfo fi(fname); + TQString filename = fi.absFilePath(); // If fname is the empty string, then this means: "close". Delete // the dvifile and the pixmap. @@ -446,7 +446,7 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) // mime type, if the file is not DVI. Perhaps we should move the // procedure later to the kviewpart, instead of the implementaton in // the multipage. - QString mimetype( KMimeMagic::self()->findFileType( fname )->mimeType() ); + TQString mimetype( KMimeMagic::self()->findFileType( fname )->mimeType() ); if (mimetype != "application/x-dvi") { KMessageBox::sorry( parentWidget, i18n( "Could not open file %1 which has " @@ -466,7 +466,7 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) return false; } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); dvifile *dviFile_new = new dvifile(filename, &font_pool); if ((dviFile == 0) || (dviFile->filename != filename)) @@ -475,7 +475,7 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) dviFile_new->sourceSpecialMarker = false; if ((dviFile_new->dvi_Data() == NULL)||(dviFile_new->errorMsg.isEmpty() != true)) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (dviFile_new->errorMsg.isEmpty() != true) KMessageBox::detailedError(parentWidget, i18n("File corruption! KDVI had trouble interpreting your DVI file. Most " @@ -504,7 +504,7 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) // web server), we limit the PostScript files that can be accessed // by this file to the download directory, in order to limit the // possibilities of a denial of service attack. - QString includePath; + TQString includePath; if (!baseURL.isLocalFile()) { includePath = filename; includePath.truncate(includePath.findRev('/')); @@ -534,7 +534,7 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) // PRESCAN STARTS HERE #ifdef PERFORMANCE_MEASUREMENT kdDebug(4300) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl; - QTime preScanTimer; + TQTime preScanTimer; preScanTimer.start(); #endif dviFile->numberOfExternalPSFiles = 0; @@ -542,7 +542,7 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) prebookmarks.clear(); for(current_page=0; current_page < dviFile->total_pages; current_page++) { - PostScriptOutPutString = new QString(); + PostScriptOutPutString = new TQString(); if (current_page < dviFile->total_pages) { command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page]; @@ -563,9 +563,9 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) // Generate the list of bookmarks bookmarks.clear(); - QPtrStack stack; + TQPtrStack stack; stack.setAutoDelete (false); - QValueVector::iterator it; + TQValueVector::iterator it; for( it = prebookmarks.begin(); it != prebookmarks.end(); ++it ) { Bookmark *bmk = new Bookmark((*it).title, findAnchor((*it).anchorName)); if (stack.isEmpty()) @@ -593,12 +593,12 @@ bool dviRenderer::setFile(const QString &fname, const KURL &base) pageSizes.resize(dviFile->total_pages, *(dviFile->suggestedPageSize)); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return true; } -Anchor dviRenderer::parseReference(const QString &reference) +Anchor dviRenderer::parseReference(const TQString &reference) { mutex.lock(); @@ -634,7 +634,7 @@ Anchor dviRenderer::parseReference(const QString &reference) // Extract the file name and the numeral part from the reference string DVI_SourceFileSplitter splitter(reference, dviFile->filename); Q_UINT32 refLineNumber = splitter.line(); - QString refFileName = splitter.filePath(); + TQString refFileName = splitter.filePath(); if (sourceHyperLinkAnchors.isEmpty()) { KMessageBox::sorry(parentWidget, i18n("You have asked KDVI to locate the place in the DVI file which corresponds to " @@ -662,8 +662,8 @@ Anchor dviRenderer::parseReference(const QString &reference) // document. bool anchorForRefFileFound = false; // Flag that is set if source file anchors for the refFileName could be found at all - QValueVector::iterator bestMatch = sourceHyperLinkAnchors.end(); - QValueVector::iterator it; + TQValueVector::iterator bestMatch = sourceHyperLinkAnchors.end(); + TQValueVector::iterator it; for( it = sourceHyperLinkAnchors.begin(); it != sourceHyperLinkAnchors.end(); ++it ) if (refFileName.stripWhiteSpace() == it->fileName.stripWhiteSpace() || refFileName.stripWhiteSpace() == it->fileName.stripWhiteSpace() + ".tex" @@ -715,11 +715,11 @@ void dviRenderer::setResolution(double resolution_in_DPI) void dviRenderer::clearStatusBar() { - emit setStatusBarText( QString::null ); + emit setStatusBarText( TQString::null ); } -void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, DocumentWidget *win) +void dviRenderer::handleSRCLink(const TQString &linkText, TQMouseEvent *e, DocumentWidget *win) { #ifdef DEBUG_SPECIAL RenderedDviPagePixmap* currentDVIPage = dynamic_cast currentlyDrawnPage; @@ -730,25 +730,25 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen #endif DVI_SourceFileSplitter splitter(linkText, dviFile->filename); - QString TeXfile = splitter.filePath(); + TQString TeXfile = splitter.filePath(); if ( ! splitter.fileExists() ) { - KMessageBox::sorry(parentWidget, QString("") + + KMessageBox::sorry(parentWidget, TQString("") + i18n("The DVI-file refers to the TeX-file " "%1 which could not be found.").arg(KShellProcess::quote(TeXfile)) + - QString(""), + TQString(""), i18n( "Could Not Find File" )); return; } - QString command = editorCommand; + TQString command = editorCommand; if (command.isEmpty() == true) { - int r = KMessageBox::warningContinueCancel(parentWidget, QString("") + + int r = KMessageBox::warningContinueCancel(parentWidget, TQString("") + i18n("You have not yet specified an editor for inverse search. " "Please choose your favorite editor in the " "DVI options dialog " "which you will find in the Settings-menu.") + - QString(""), + TQString(""), i18n("Need to Specify Editor"), i18n("Use KDE's Editor Kate for Now")); if (r == KMessageBox::Continue) @@ -756,7 +756,7 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen else return; } - command = command.replace( "%l", QString::number(splitter.line()) ).replace( "%f", KShellProcess::quote(TeXfile) ); + command = command.replace( "%l", TQString::number(splitter.line()) ).replace( "%f", KShellProcess::quote(TeXfile) ); #ifdef DEBUG_SPECIAL kdDebug(4300) << "Calling program: " << command << endl; @@ -767,8 +767,8 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen // henceforth dimiss the output of the older programm. "If it // hasn't failed until now, we don't care." if (proc != 0) { - qApp->disconnect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)), 0, 0); - qApp->disconnect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), 0, 0); + qApp->disconnect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), 0, 0); + qApp->disconnect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), 0, 0); proc = 0; } @@ -778,9 +778,9 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen kdError(4300) << "Could not allocate ShellProcess for the editor command." << endl; return; } - qApp->connect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int))); - qApp->connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int))); - qApp->connect(proc, SIGNAL(processExited(KProcess *)), this, SLOT(editorCommand_terminated(KProcess *))); + qApp->connect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), this, TQT_SLOT(dvips_output_receiver(KProcess *, char *, int))); + qApp->connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), this, TQT_SLOT(dvips_output_receiver(KProcess *, char *, int))); + qApp->connect(proc, TQT_SIGNAL(processExited(KProcess *)), this, TQT_SLOT(editorCommand_terminated(KProcess *))); // Merge the editor-specific editor message here. export_errorString = i18n("The external program

%1

which was used to call the editor " "for inverse search, reported an error. You might wish to look at the document info " @@ -804,12 +804,12 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen } -QString dviRenderer::PDFencodingToQString(const QString& _pdfstring) +TQString dviRenderer::PDFencodingToQString(const TQString& _pdfstring) { // This method locates special PDF characters in a string and // replaces them by UTF8. See Section 3.2.3 of the PDF reference // guide for information. - QString pdfstring = _pdfstring; + TQString pdfstring = _pdfstring; pdfstring = pdfstring.replace("\\n", "\n"); pdfstring = pdfstring.replace("\\r", "\n"); pdfstring = pdfstring.replace("\\t", "\t"); @@ -820,17 +820,17 @@ QString dviRenderer::PDFencodingToQString(const QString& _pdfstring) // Now replace octal character codes with the characters they encode int pos; - QRegExp rx( "(\\\\)(\\d\\d\\d)" ); // matches "\xyz" where x,y,z are numbers + TQRegExp rx( "(\\\\)(\\d\\d\\d)" ); // matches "\xyz" where x,y,z are numbers while((pos = rx.search( pdfstring )) != -1) { - pdfstring = pdfstring.replace(pos, 4, QChar(rx.cap(2).toInt(0,8))); + pdfstring = pdfstring.replace(pos, 4, TQChar(rx.cap(2).toInt(0,8))); } rx.setPattern( "(\\\\)(\\d\\d)" ); // matches "\xy" where x,y are numbers while((pos = rx.search( pdfstring )) != -1) { - pdfstring = pdfstring.replace(pos, 3, QChar(rx.cap(2).toInt(0,8))); + pdfstring = pdfstring.replace(pos, 3, TQChar(rx.cap(2).toInt(0,8))); } rx.setPattern( "(\\\\)(\\d)" ); // matches "\x" where x is a number while((pos = rx.search( pdfstring )) != -1) { - pdfstring = pdfstring.replace(pos, 4, QChar(rx.cap(2).toInt(0,8))); + pdfstring = pdfstring.replace(pos, 4, TQChar(rx.cap(2).toInt(0,8))); } return pdfstring; } diff --git a/kdvi/dviRenderer.h b/kdvi/dviRenderer.h index 98f0f4bd..863a2786 100644 --- a/kdvi/dviRenderer.h +++ b/kdvi/dviRenderer.h @@ -15,11 +15,11 @@ #include "fontpool.h" #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include class Anchor; class DocumentWidget; @@ -41,11 +41,11 @@ extern const int MFResolutions[]; class DVI_SourceFileAnchor { public: DVI_SourceFileAnchor() {} - DVI_SourceFileAnchor(const QString& name, Q_UINT32 ln, Q_UINT32 pg, const Length& _distance_from_top) + DVI_SourceFileAnchor(const TQString& name, Q_UINT32 ln, Q_UINT32 pg, const Length& _distance_from_top) : fileName(name), line(ln), page(pg), distance_from_top(_distance_from_top) {} - QString fileName; + TQString fileName; Q_UINT32 line; Q_UINT32 page; Length distance_from_top; @@ -76,7 +76,7 @@ struct drawinf { TeXFontDefinition *fontp; set_char_proc set_char_p; - QIntDict *fonttable; + TQIntDict *fonttable; TeXFontDefinition *_virtual; }; @@ -87,20 +87,20 @@ class dviRenderer : public DocumentRenderer, bigEndianByteReader Q_OBJECT public: - dviRenderer(QWidget *parent); + dviRenderer(TQWidget *parent); ~dviRenderer(); - virtual bool setFile(const QString &fname, const KURL &base); + virtual bool setFile(const TQString &fname, const KURL &base); class dvifile *dviFile; - void setPrefs(bool flag_showPS, const QString &editorCommand, bool useFontHints ); + void setPrefs(bool flag_showPS, const TQString &editorCommand, bool useFontHints ); virtual bool supportsTextSearch() const {return true;} bool showPS() { return _postscript; } int curr_page() { return current_page+1; } - virtual bool isValidFile(const QString& fileName) const; + virtual bool isValidFile(const TQString& fileName) const; /** This method will try to parse the reference part of the DVI @@ -108,7 +108,7 @@ public: number, or src:) and see if a corresponding section of the DVI file can be found. If so, it returns an anchor to that section. If not, it returns an invalid anchor. */ - virtual Anchor parseReference(const QString &reference); + virtual Anchor parseReference(const TQString &reference); // These should not be public... only for the moment void read_postamble(); @@ -120,23 +120,23 @@ public: void applicationDoSpecial(char * cp); void special(long nbytes); - void printErrorMsgForSpecials(const QString& msg); - void color_special(const QString& cp); - void html_href_special(const QString& cp); + void printErrorMsgForSpecials(const TQString& msg); + void color_special(const TQString& cp); + void html_href_special(const TQString& cp); void html_anchor_end(); void draw_page(); public slots: - void exportPS(const QString& fname = QString::null, const QString& options = QString::null, KPrinter* printer = 0); + void exportPS(const TQString& fname = TQString::null, const TQString& options = TQString::null, KPrinter* printer = 0); void exportPDF(); void showInfo(); - void handleSRCLink(const QString &linkText, QMouseEvent *e, DocumentWidget *widget); + void handleSRCLink(const TQString &linkText, TQMouseEvent *e, DocumentWidget *widget); void embedPostScript(); void abortExternalProgramm(); - /** simply emits "setStatusBarText( QString::null )". This is used + /** simply emits "setStatusBarText( TQString::null )". This is used in dviRenderer::mouseMoveEvent(), see the explanation there. */ void clearStatusBar(); @@ -150,7 +150,7 @@ public slots: signals: /** Passed through to the top-level kpart. */ - // void setStatusBarText( const QString& ); + // void setStatusBarText( const TQString& ); private slots: /** This method shows a dialog that tells the user that source @@ -169,17 +169,17 @@ private: /** This method parses a color specification of type "gray 0.5", "rgb 0.5 0.7 1.0", "hsb ...", "cmyk .." or "PineGreen". See the source code for details. */ - QColor parseColorSpecification(const QString& colorSpec); + TQColor parseColorSpecification(const TQString& colorSpec); /** This map contains the colors which are known by name. This field is initialized in the method parseColorSpecification() as soon as it is needed. */ - QMap namedColors; + TQMap namedColors; /* This method locates special PDF characters in a string and replaces them by UTF8. See Section 3.2.3 of the PDF reference guide for information */ - QString PDFencodingToQString(const QString& pdfstring); + TQString PDFencodingToQString(const TQString& pdfstring); void setResolution(double resolution_in_DPI); @@ -193,19 +193,19 @@ private: void prescan_embedPS(char *cp, Q_UINT8 *); void prescan_removePageSizeInfo(char *cp, Q_UINT8 *); void prescan_parseSpecials(char *cp, Q_UINT8 *); - void prescan_ParsePapersizeSpecial(const QString& cp); - void prescan_ParseBackgroundSpecial(const QString& cp); - void prescan_ParseHTMLAnchorSpecial(const QString& cp); - void prescan_ParsePSHeaderSpecial(const QString& cp); - void prescan_ParsePSBangSpecial(const QString& cp); - void prescan_ParsePSQuoteSpecial(const QString& cp); - void prescan_ParsePSSpecial(const QString& cp); - void prescan_ParsePSFileSpecial(const QString& cp); - void prescan_ParseSourceSpecial(const QString& cp); + void prescan_ParsePapersizeSpecial(const TQString& cp); + void prescan_ParseBackgroundSpecial(const TQString& cp); + void prescan_ParseHTMLAnchorSpecial(const TQString& cp); + void prescan_ParsePSHeaderSpecial(const TQString& cp); + void prescan_ParsePSBangSpecial(const TQString& cp); + void prescan_ParsePSQuoteSpecial(const TQString& cp); + void prescan_ParsePSSpecial(const TQString& cp); + void prescan_ParsePSFileSpecial(const TQString& cp); + void prescan_ParseSourceSpecial(const TQString& cp); void prescan_setChar(unsigned int ch); /* */ - QValueVector prebookmarks; + TQValueVector prebookmarks; @@ -216,15 +216,15 @@ private: /** Shrink factor. Units are not quite clear */ double shrinkfactor; - QString errorMsg; + TQString errorMsg; /** Methods which handle certain special commands. */ - void epsf_special(const QString& cp); - void source_special(const QString& cp); + void epsf_special(const TQString& cp); + void source_special(const TQString& cp); /** TPIC specials */ - void TPIC_setPen_special(const QString& cp); - void TPIC_addPath_special(const QString& cp); + void TPIC_setPen_special(const TQString& cp); + void TPIC_addPath_special(const TQString& cp); void TPIC_flushPath_special(); /** This timer is used to delay clearing of the statusbar. Clearing @@ -232,39 +232,39 @@ private: mouse moves over a block of text that contains source hyperlinks. The signal timeout() is connected to the method clearStatusBar() of *this. */ - QTimer clearStatusBarTimer; + TQTimer clearStatusBarTimer; // List of source-hyperlinks on all pages. This vector is generated // when the DVI-file is first loaded, i.e. when draw_part is called // with PostScriptOutPutString != NULL - QValueVector sourceHyperLinkAnchors; + TQValueVector sourceHyperLinkAnchors; // If not NULL, the text currently drawn represents a source // hyperlink to the (relative) URL given in the string; - QString *source_href; + TQString *source_href; // If not NULL, the text currently drawn represents a hyperlink to // the (relative) URL given in the string; - QString *HTML_href; + TQString *HTML_href; - QString editorCommand; + TQString editorCommand; /** Stack for register compounds, used for the DVI-commands PUSH/POP as explained in section 2.5 and 2.6.2 of the DVI driver standard, Level 0, published by the TUG DVI driver standards committee. */ - QValueStack stack; + TQValueStack stack; /** A stack where color are stored, according to the documentation of DVIPS */ - QValueStack colorStack; + TQValueStack colorStack; /** The global color is to be used when the color stack is empty */ - QColor globalColor; + TQColor globalColor; /** If PostScriptOutPutFile is non-zero, then no rendering takes place. Instead, the PostScript code which is generated by the \special-commands is written to the PostScriptString */ - QString *PostScriptOutPutString; + TQString *PostScriptOutPutString; ghostscript_interface *PS_interface; @@ -284,13 +284,13 @@ private: fontProgressDialog *progress; KShellProcess *proc; KPrinter *export_printer; - QString export_fileName; - QString export_tmpFileName; - QString export_errorString; + TQString export_fileName; + TQString export_tmpFileName; + TQString export_errorString; /** Data required for handling TPIC specials */ float penWidth_in_mInch; - QPointArray TPIC_path; + TQPointArray TPIC_path; Q_UINT16 number_of_elements_in_path; struct drawinf currinf; diff --git a/kdvi/dviRenderer_draw.cpp b/kdvi/dviRenderer_draw.cpp index d09caf6d..b65f240e 100644 --- a/kdvi/dviRenderer_draw.cpp +++ b/kdvi/dviRenderer_draw.cpp @@ -70,13 +70,13 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -extern QPainter *foreGroundPainter; +extern TQPainter *foreGroundPainter; /** Routine to print characters. */ @@ -97,7 +97,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch) long dvi_h_sav = currinf.data.dvi_h; - QPixmap pix = g->shrunkenCharacter; + TQPixmap pix = g->shrunkenCharacter; int x = ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))) - g->x2; int y = currinf.data.pxl_v - g->y2; @@ -117,7 +117,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch) dhl.linkText = *HTML_href; currentlyDrawnPage->hyperLinkList.push_back(dhl); } else { - QRect dshunion = currentlyDrawnPage->hyperLinkList[currentlyDrawnPage->hyperLinkList.size()-1].box.unite(QRect(x, y, pix.width(), pix.height())) ; + TQRect dshunion = currentlyDrawnPage->hyperLinkList[currentlyDrawnPage->hyperLinkList.size()-1].box.unite(TQRect(x, y, pix.width(), pix.height())) ; currentlyDrawnPage->hyperLinkList[currentlyDrawnPage->hyperLinkList.size()-1].box = dshunion; } } @@ -141,7 +141,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch) dhl.linkText = ""; currentDVIPage->sourceHyperLinkList.push_back(dhl); } else { - QRect dshunion = currentDVIPage->sourceHyperLinkList[currentDVIPage->sourceHyperLinkList.size()-1].box.unite(QRect(x, y, pix.width(), pix.height())) ; + TQRect dshunion = currentDVIPage->sourceHyperLinkList[currentDVIPage->sourceHyperLinkList.size()-1].box.unite(TQRect(x, y, pix.width(), pix.height())) ; currentDVIPage->sourceHyperLinkList[currentDVIPage->sourceHyperLinkList.size()-1].box = dshunion; } } @@ -188,7 +188,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch) default: if ((ch >= 0x21) && (ch <= 0x7a)) - currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += QChar(ch); + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += TQChar(ch); else currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "?"; break; diff --git a/kdvi/dviRenderer_export.cpp b/kdvi/dviRenderer_export.cpp index 4745bf18..5fbdbf35 100644 --- a/kdvi/dviRenderer_export.cpp +++ b/kdvi/dviRenderer_export.cpp @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include "dviRenderer.h" #include "dviFile.h" @@ -45,7 +45,7 @@ #include "infodialog.h" #include "kdvi_multipage.h" -extern QPainter foreGroundPaint; // QPainter used for text +extern TQPainter foreGroundPaint; // TQPainter used for text @@ -60,8 +60,8 @@ void dviRenderer::exportPDF() // has been called meanwhile. See also the exportPS method. if (proc != 0) { // Make sure all further output of the programm is ignored - qApp->disconnect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)), 0, 0); - qApp->disconnect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), 0, 0); + qApp->disconnect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), 0, 0); + qApp->disconnect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), 0, 0); proc = 0; } @@ -70,11 +70,11 @@ void dviRenderer::exportPDF() return; // Is the dvipdfm-Programm available ?? - QStringList texList = QStringList::split(":", QString::fromLocal8Bit(getenv("PATH"))); + TQStringList texList = TQStringList::split(":", TQString::fromLocal8Bit(getenv("PATH"))); bool found = false; - for (QStringList::Iterator it=texList.begin(); it!=texList.end(); ++it) { - QString temp = (*it) + "/" + "dvipdfm"; - if (QFile::exists(temp)) { + for (TQStringList::Iterator it=texList.begin(); it!=texList.end(); ++it) { + TQString temp = (*it) + "/" + "dvipdfm"; + if (TQFile::exists(temp)) { found = true; break; } @@ -92,13 +92,13 @@ void dviRenderer::exportPDF() } // Generate a suggestion for a reasonable file name - QString suggestedName = dviFile->filename; + TQString suggestedName = dviFile->filename; suggestedName = suggestedName.left(suggestedName.find(".")) + ".pdf"; - QString fileName = KFileDialog::getSaveFileName(suggestedName, i18n("*.pdf|Portable Document Format (*.pdf)"), parentWidget, i18n("Export File As")); + TQString fileName = KFileDialog::getSaveFileName(suggestedName, i18n("*.pdf|Portable Document Format (*.pdf)"), parentWidget, i18n("Export File As")); if (fileName.isEmpty()) return; - QFileInfo finfo(fileName); + TQFileInfo finfo(fileName); if (finfo.exists()) { int r = KMessageBox::warningContinueCancel (parentWidget, i18n("The file %1\nexists. Do you want to overwrite that file?").arg(fileName), i18n("Overwrite File"), i18n("Overwrite")); @@ -107,9 +107,9 @@ void dviRenderer::exportPDF() } // Initialize the progress dialog - progress = new fontProgressDialog( QString::null, + progress = new fontProgressDialog( TQString::null, i18n("Using dvipdfm to export the file to PDF"), - QString::null, + TQString::null, i18n("KDVI is currently using the external program 'dvipdfm' to " "convert your DVI-file to PDF. Sometimes that can take " "a while because dvipdfm needs to generate its own bitmap fonts " @@ -119,7 +119,7 @@ void dviRenderer::exportPDF() if (progress != 0) { progress->TextLabel2->setText( i18n("Please be patient") ); progress->setTotalSteps( dviFile->total_pages ); - qApp->connect(progress, SIGNAL(finished()), this, SLOT(abortExternalProgramm())); + qApp->connect(progress, TQT_SIGNAL(finished()), this, TQT_SLOT(abortExternalProgramm())); } proc = new KShellProcess(); @@ -127,11 +127,11 @@ void dviRenderer::exportPDF() kdError(4300) << "Could not allocate ShellProcess for the dvipdfm command." << endl; return; } - qApp->disconnect( this, SIGNAL(mySignal()), 0, 0 ); + qApp->disconnect( this, TQT_SIGNAL(mySignal()), 0, 0 ); - qApp->connect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int))); - qApp->connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int))); - qApp->connect(proc, SIGNAL(processExited(KProcess *)), this, SLOT(dvips_terminated(KProcess *))); + qApp->connect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), this, TQT_SLOT(dvips_output_receiver(KProcess *, char *, int))); + qApp->connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), this, TQT_SLOT(dvips_output_receiver(KProcess *, char *, int))); + qApp->connect(proc, TQT_SIGNAL(processExited(KProcess *)), this, TQT_SLOT(dvips_terminated(KProcess *))); export_errorString = i18n("The external program 'dvipdf', which was used to export the file, reported an error. " "You might wish to look at the document info dialog which you will " @@ -140,8 +140,8 @@ void dviRenderer::exportPDF() proc->clearArguments(); finfo.setFile(dviFile->filename); - *proc << QString("cd %1; dvipdfm").arg(KShellProcess::quote(finfo.dirPath(true))); - *proc << QString("-o %1").arg(KShellProcess::quote(fileName)); + *proc << TQString("cd %1; dvipdfm").arg(KShellProcess::quote(finfo.dirPath(true))); + *proc << TQString("-o %1").arg(KShellProcess::quote(fileName)); *proc << KShellProcess::quote(dviFile->filename); proc->closeStdin(); if (proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) { @@ -152,7 +152,7 @@ void dviRenderer::exportPDF() } -void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinter* printer) +void dviRenderer::exportPS(const TQString& fname, const TQString& options, KPrinter* printer) { // Safety check. if (dviFile->page_offset.isEmpty() == true) @@ -166,8 +166,8 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte // enough to ignore the exit status of the editor if another command // has been called meanwhile. See also the exportPDF method. if (proc != 0) { - qApp->disconnect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)), 0, 0); - qApp->disconnect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), 0, 0); + qApp->disconnect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), 0, 0); + qApp->disconnect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), 0, 0); proc = 0; } @@ -188,16 +188,16 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte return; } - QString fileName; + TQString fileName; if (fname.isEmpty()) { // Generate a suggestion for a reasonable file name - QString suggestedName = dviFile->filename; + TQString suggestedName = dviFile->filename; suggestedName = suggestedName.left(suggestedName.find(".")) + ".ps"; fileName = KFileDialog::getSaveFileName(suggestedName, i18n("*.ps|PostScript (*.ps)"), parentWidget, i18n("Export File As")); if (fileName.isEmpty()) return; - QFileInfo finfo(fileName); + TQFileInfo finfo(fileName); if (finfo.exists()) { int r = KMessageBox::warningYesNo (parentWidget, i18n("The file %1\nexists. Do you want to overwrite that file?").arg(fileName), i18n("Overwrite File")); @@ -210,9 +210,9 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte export_printer = printer; // Initialize the progress dialog - progress = new fontProgressDialog( QString::null, + progress = new fontProgressDialog( TQString::null, i18n("Using dvips to export the file to PostScript"), - QString::null, + TQString::null, i18n("KDVI is currently using the external program 'dvips' to " "convert your DVI-file to PostScript. Sometimes that can take " "a while because dvips needs to generate its own bitmap fonts " @@ -222,7 +222,7 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte if (progress != 0) { progress->TextLabel2->setText( i18n("Please be patient") ); progress->setTotalSteps( dviFile->total_pages ); - qApp->connect(progress, SIGNAL(finished()), this, SLOT(abortExternalProgramm())); + qApp->connect(progress, TQT_SIGNAL(finished()), this, TQT_SLOT(abortExternalProgramm())); } // There is a major problem with dvips, at least 5.86 and lower: the @@ -246,7 +246,7 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte // Sourcefile is the name of the DVI which is used by dvips, either // the original file, or a temporary file with a new numbering. - QString sourceFileName = dviFile->filename; + TQString sourceFileName = dviFile->filename; if ((options.isEmpty() == false) || (dviFile->suggestedPageSize != 0) ) { // Get a name for a temporary file. KTempFile export_tmpFile; @@ -265,7 +265,7 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte Q_UINT16 currPageSav = current_page; dvifile *dvsav = dviFile; dviFile = &newFile; - errorMsg = QString::null; + errorMsg = TQString::null; for(current_page=0; current_page < newFile.total_pages; current_page++) { @@ -293,23 +293,23 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte return; } - qApp->connect(proc, SIGNAL(receivedStderr(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int))); - qApp->connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int))); - qApp->connect(proc, SIGNAL(processExited(KProcess *)), this, SLOT(dvips_terminated(KProcess *))); + qApp->connect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), this, TQT_SLOT(dvips_output_receiver(KProcess *, char *, int))); + qApp->connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), this, TQT_SLOT(dvips_output_receiver(KProcess *, char *, int))); + qApp->connect(proc, TQT_SIGNAL(processExited(KProcess *)), this, TQT_SLOT(dvips_terminated(KProcess *))); export_errorString = i18n("The external program 'dvips', which was used to export the file, reported an error. " "You might wish to look at the document info dialog which you will " "find in the File-Menu for a precise error report.") ; info->clear(i18n("Export: %1 to PostScript").arg(KShellProcess::quote(dviFile->filename))); proc->clearArguments(); - QFileInfo finfo(dviFile->filename); - *proc << QString("cd %1; dvips").arg(KShellProcess::quote(finfo.dirPath(true))); + TQFileInfo finfo(dviFile->filename); + *proc << TQString("cd %1; dvips").arg(KShellProcess::quote(finfo.dirPath(true))); if (printer == 0) *proc << "-z"; // export Hyperlinks if (options.isEmpty() == false) *proc << options; - *proc << QString("%1").arg(KShellProcess::quote(sourceFileName)); - *proc << QString("-o %1").arg(KShellProcess::quote(fileName)); + *proc << TQString("%1").arg(KShellProcess::quote(sourceFileName)); + *proc << TQString("-o %1").arg(KShellProcess::quote(fileName)); proc->closeStdin(); if (proc->start(KProcess::NotifyOnExit, KProcess::Stderr) == false) { kdError(4300) << "dvips failed to start" << endl; @@ -324,7 +324,7 @@ void dviRenderer::dvips_output_receiver(KProcess *, char *buffer, int buflen) // Paranoia. if (buflen < 0) return; - QString op = QString::fromLocal8Bit(buffer, buflen); + TQString op = TQString::fromLocal8Bit(buffer, buflen); info->outputReceiver(op); if (progress != 0) @@ -343,7 +343,7 @@ void dviRenderer::dvips_terminated(KProcess *sproc) KMessageBox::error( parentWidget, export_errorString ); if (export_printer != 0) - export_printer->printFiles( QStringList(export_fileName), true ); + export_printer->printFiles( TQStringList(export_fileName), true ); // Kill and delete the remaining process, delete the printer, etc. abortExternalProgramm(); @@ -375,7 +375,7 @@ void dviRenderer::abortExternalProgramm() proc = 0; if (export_tmpFileName.isEmpty() != true) { - unlink(QFile::encodeName(export_tmpFileName)); // That should delete the file. + unlink(TQFile::encodeName(export_tmpFileName)); // That should delete the file. export_tmpFileName = ""; } diff --git a/kdvi/dviRenderer_prescan.cpp b/kdvi/dviRenderer_prescan.cpp index 59bdeb25..d0c35bbd 100644 --- a/kdvi/dviRenderer_prescan.cpp +++ b/kdvi/dviRenderer_prescan.cpp @@ -24,17 +24,17 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -extern QPainter foreGroundPaint; -extern void parse_special_argument(const QString& strg, const char* argument_name, int* variable); +extern TQPainter foreGroundPaint; +extern void parse_special_argument(const TQString& strg, const char* argument_name, int* variable); //#define DEBUG_PRESCAN @@ -50,16 +50,16 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand) if (strncasecmp(cp, "PSfile=", 7) != 0) return; - QString command(cp+7); + TQString command(cp+7); - QString include_command = command.simplifyWhiteSpace(); + TQString include_command = command.simplifyWhiteSpace(); // The line is supposed to start with "..ile=", and then comes the // filename. Figure out what the filename is and stow it away. Of // course, this does not work if the filename contains spaces // (already the simplifyWhiteSpace() above is wrong). If you have // files like this, go away. - QString EPSfilename = include_command; + TQString EPSfilename = include_command; EPSfilename.truncate(EPSfilename.find(' ')); // Strip enclosing quotation marks which are included by some LaTeX @@ -73,7 +73,7 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand) // The graphic file is later read when the page is rendered. KMimeType::Ptr const mime_type = KMimeType::findByFileContent(EPSfilename); - QString const & mime_type_name = mime_type->name(); + TQString const & mime_type_name = mime_type->name(); bool const is_ps_file = (mime_type_name == "application/postscript" || mime_type_name == "image/x-eps"); @@ -82,7 +82,7 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand) if (!(is_ps_file || is_pdf_file)) return; - QString originalFName = EPSfilename; + TQString originalFName = EPSfilename; embedPS_progress->setLabel(i18n("Embedding %1").arg(EPSfilename)); qApp->processEvents(); @@ -95,7 +95,7 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand) if (is_pdf_file) EPSfilename = dviFile->convertPDFtoPS(EPSfilename); - if (!QFile::exists(EPSfilename)) { + if (!TQFile::exists(EPSfilename)) { // Find the number of the page Q_UINT32 currentOffset = beginningOfSpecialCommand - dviFile->dvi_Data(); Q_UINT16 page; @@ -131,20 +131,20 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand) int clip=include_command.find(" clip"); // -1 if clip keyword is not present, >= 0 otherwise // Generate the PostScript commands to be included - QString PS = QString("ps: @beginspecial %1 @llx %2 @lly %3 @urx %4 @ury").arg(llx).arg(lly).arg(urx).arg(ury); + TQString PS = TQString("ps: @beginspecial %1 @llx %2 @lly %3 @urx %4 @ury").arg(llx).arg(lly).arg(urx).arg(ury); if (rwi != 0) - PS.append( QString(" %1 @rwi").arg(rwi) ); + PS.append( TQString(" %1 @rwi").arg(rwi) ); if (rhi != 0) - PS.append( QString(" %1 @rhi").arg(rhi) ); + PS.append( TQString(" %1 @rhi").arg(rhi) ); if (angle != 0) - PS.append( QString(" %1 @angle").arg(angle) ); + PS.append( TQString(" %1 @angle").arg(angle) ); if (clip != -1) PS.append(" @clip"); PS.append( " @setspecial\n" ); - QFile file( EPSfilename ); + TQFile file( EPSfilename ); if ( file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.atEnd() ) { PS += stream.readLine().section( '%', 0, 0); PS += "\n"; @@ -159,7 +159,7 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand) Q_UINT32 lengthOfOldSpecial = command_pointer - beginningOfSpecialCommand; Q_UINT32 lengthOfNewSpecial = PS.length()+5; - QMemArray newDVI(dviFile->size_of_file + lengthOfNewSpecial-lengthOfOldSpecial); + TQMemArray newDVI(dviFile->size_of_file + lengthOfNewSpecial-lengthOfOldSpecial); Q_UINT8 *commandPtrSav = command_pointer; Q_UINT8 *endPtrSav = end_pointer; @@ -239,13 +239,13 @@ void dviRenderer::prescan_removePageSizeInfo(char *cp, Q_UINT8 *beginningOfSpeci } -void dviRenderer::prescan_ParsePapersizeSpecial(const QString& _cp) +void dviRenderer::prescan_ParsePapersizeSpecial(const TQString& _cp) { #ifdef DEBUG_PRESCAN kdDebug(4300) << "Papersize-Special : papersize" << cp << endl; #endif - QString cp = _cp.simplifyWhiteSpace(); + TQString cp = _cp.simplifyWhiteSpace(); if (cp[0] == '=') { cp = cp.mid(1); @@ -258,9 +258,9 @@ void dviRenderer::prescan_ParsePapersizeSpecial(const QString& _cp) } -void dviRenderer::prescan_ParseBackgroundSpecial(const QString& cp) +void dviRenderer::prescan_ParseBackgroundSpecial(const TQString& cp) { - QColor col = parseColorSpecification(cp.stripWhiteSpace()); + TQColor col = parseColorSpecification(cp.stripWhiteSpace()); if (col.isValid()) for(Q_UINT16 page=current_page; page < dviFile->total_pages; page++) PS_interface->setBackgroundColor(page, col); @@ -268,9 +268,9 @@ void dviRenderer::prescan_ParseBackgroundSpecial(const QString& cp) } -void dviRenderer::prescan_ParseHTMLAnchorSpecial(const QString& _cp) +void dviRenderer::prescan_ParseHTMLAnchorSpecial(const TQString& _cp) { - QString cp = _cp; + TQString cp = _cp; cp.truncate(cp.find('"')); Length l; l.setLength_in_inch(currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); @@ -278,17 +278,17 @@ void dviRenderer::prescan_ParseHTMLAnchorSpecial(const QString& _cp) } -void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp) +void dviRenderer::prescan_ParsePSHeaderSpecial(const TQString& cp) { #ifdef DEBUG_PRESCAN kdDebug(4300) << "PostScript-special, header " << cp.latin1() << endl; #endif - QString _file = cp; + TQString _file = cp; // If the file is not found in the current directory, use kpsewhich // to find it. - if (!QFile::exists(_file)) { + if (!TQFile::exists(_file)) { // Otherwise, use kpsewhich to find the eps file. KProcIO proc; proc << "kpsewhich" << cp; @@ -296,12 +296,12 @@ void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp) proc.readln(_file); } - if (QFile::exists(_file)) - PS_interface->PostScriptHeaderString->append( QString(" (%1) run\n").arg(_file) ); + if (TQFile::exists(_file)) + PS_interface->PostScriptHeaderString->append( TQString(" (%1) run\n").arg(_file) ); } -void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp) +void dviRenderer::prescan_ParsePSBangSpecial(const TQString& cp) { #ifdef DEBUG_PRESCAN kdDebug(4300) << "PostScript-special, literal header " << cp.latin1() << endl; @@ -313,7 +313,7 @@ void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp) } -void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp) +void dviRenderer::prescan_ParsePSQuoteSpecial(const TQString& cp) { #ifdef DEBUG_PRESCAN kdError(4300) << "PostScript-special, literal PostScript " << cp.latin1() << endl; @@ -321,14 +321,14 @@ void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp) double PS_H = (currinf.data.dvi_h*300.0)/(65536*1200)-300; double PS_V = (currinf.data.dvi_v*300.0)/1200 - 300; - PostScriptOutPutString->append( QString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); + PostScriptOutPutString->append( TQString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); PostScriptOutPutString->append( " @beginspecial @setspecial \n" ); PostScriptOutPutString->append( cp ); PostScriptOutPutString->append( " @endspecial \n" ); } -void dviRenderer::prescan_ParsePSSpecial(const QString& cp) +void dviRenderer::prescan_ParsePSSpecial(const TQString& cp) { #ifdef DEBUG_PRESCAN kdDebug(4300) << "PostScript-special, direct PostScript " << cp << endl; @@ -356,7 +356,7 @@ void dviRenderer::prescan_ParsePSSpecial(const QString& cp) return; // hyperref tries to work around Distiller bug if (cp.startsWith("ps:SDict begin [") && cp.endsWith(" pdfmark end")) { // hyperref definition of link/anchor/bookmark/etc if (cp.contains("/DEST")) { // The PostScript code defines an anchor - QString anchorName = cp.section('(', 1, 1).section(')', 0, 0); + TQString anchorName = cp.section('(', 1, 1).section(')', 0, 0); Length l; l.setLength_in_inch(currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); anchorList[anchorName] = Anchor(current_page+1, l); @@ -375,37 +375,37 @@ void dviRenderer::prescan_ParsePSSpecial(const QString& cp) double PS_V = (currinf.data.dvi_v*300.0)/1200 - 300; if (cp.find("ps::[begin]", 0, false) == 0) { - PostScriptOutPutString->append( QString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); - PostScriptOutPutString->append( QString(" %1\n").arg(cp.mid(11)) ); + PostScriptOutPutString->append( TQString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); + PostScriptOutPutString->append( TQString(" %1\n").arg(cp.mid(11)) ); } else { if (cp.find("ps::[end]", 0, false) == 0) { - PostScriptOutPutString->append( QString(" %1\n").arg(cp.mid(9)) ); + PostScriptOutPutString->append( TQString(" %1\n").arg(cp.mid(9)) ); } else { if (cp.find("ps::", 0, false) == 0) { - PostScriptOutPutString->append( QString(" %1\n").arg(cp.mid(4)) ); + PostScriptOutPutString->append( TQString(" %1\n").arg(cp.mid(4)) ); } else { - PostScriptOutPutString->append( QString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); - PostScriptOutPutString->append( QString(" %1\n").arg(cp.mid(3)) ); + PostScriptOutPutString->append( TQString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); + PostScriptOutPutString->append( TQString(" %1\n").arg(cp.mid(3)) ); } } } } -void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp) +void dviRenderer::prescan_ParsePSFileSpecial(const TQString& cp) { #ifdef DEBUG_PRESCAN kdDebug(4300) << "epsf-special: psfile=" << cp <numberOfExternalNONPSFiles++; return; @@ -456,25 +456,25 @@ void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp) int clip=include_command.find(" clip"); // -1 if clip keyword is not present, >= 0 otherwise - if (QFile::exists(EPSfilename)) { + if (TQFile::exists(EPSfilename)) { double PS_H = (currinf.data.dvi_h*300.0)/(65536*1200)-300; double PS_V = (currinf.data.dvi_v*300.0)/1200 - 300; - PostScriptOutPutString->append( QString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); + PostScriptOutPutString->append( TQString(" %1 %2 moveto\n").arg(PS_H).arg(PS_V) ); PostScriptOutPutString->append( "@beginspecial " ); - PostScriptOutPutString->append( QString(" %1 @llx").arg(llx) ); - PostScriptOutPutString->append( QString(" %1 @lly").arg(lly) ); - PostScriptOutPutString->append( QString(" %1 @urx").arg(urx) ); - PostScriptOutPutString->append( QString(" %1 @ury").arg(ury) ); + PostScriptOutPutString->append( TQString(" %1 @llx").arg(llx) ); + PostScriptOutPutString->append( TQString(" %1 @lly").arg(lly) ); + PostScriptOutPutString->append( TQString(" %1 @urx").arg(urx) ); + PostScriptOutPutString->append( TQString(" %1 @ury").arg(ury) ); if (rwi != 0) - PostScriptOutPutString->append( QString(" %1 @rwi").arg(rwi) ); + PostScriptOutPutString->append( TQString(" %1 @rwi").arg(rwi) ); if (rhi != 0) - PostScriptOutPutString->append( QString(" %1 @rhi").arg(rhi) ); + PostScriptOutPutString->append( TQString(" %1 @rhi").arg(rhi) ); if (angle != 0) - PostScriptOutPutString->append( QString(" %1 @angle").arg(angle) ); + PostScriptOutPutString->append( TQString(" %1 @angle").arg(angle) ); if (clip != -1) PostScriptOutPutString->append(" @clip"); PostScriptOutPutString->append( " @setspecial \n" ); - PostScriptOutPutString->append( QString(" (%1) run\n").arg(EPSfilename) ); + PostScriptOutPutString->append( TQString(" (%1) run\n").arg(EPSfilename) ); PostScriptOutPutString->append( "@endspecial \n" ); } @@ -482,7 +482,7 @@ void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp) } -void dviRenderer::prescan_ParseSourceSpecial(const QString& cp) +void dviRenderer::prescan_ParseSourceSpecial(const TQString& cp) { // if no rendering takes place, i.e. when the DVI file is first // loaded, generate a DVI_SourceFileAnchor. These anchors are used @@ -495,8 +495,8 @@ void dviRenderer::prescan_ParseSourceSpecial(const QString& cp) if (!cp.at(j).isNumber()) break; Q_UINT32 sourceLineNumber = cp.left(j).toUInt(); - QFileInfo fi1(dviFile->filename); - QString sourceFileName = QFileInfo(fi1.dir(), cp.mid(j).stripWhiteSpace()).absFilePath(); + TQFileInfo fi1(dviFile->filename); + TQString sourceFileName = TQFileInfo(fi1.dir(), cp.mid(j).stripWhiteSpace()).absFilePath(); Length l; l.setLength_in_inch(currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); DVI_SourceFileAnchor sfa(sourceFileName, sourceLineNumber, current_page+1, l); @@ -506,7 +506,7 @@ void dviRenderer::prescan_ParseSourceSpecial(const QString& cp) void dviRenderer::prescan_parseSpecials(char *cp, Q_UINT8 *) { - QString special_command(cp); + TQString special_command(cp); // Now to those specials which are only interpreted during the // prescan phase, and NOT during rendering. diff --git a/kdvi/dviWidget.cpp b/kdvi/dviWidget.cpp index 8475af92..ddcac8e6 100644 --- a/kdvi/dviWidget.cpp +++ b/kdvi/dviWidget.cpp @@ -22,13 +22,13 @@ #include "renderedDviPagePixmap.h" #include "selection.h" -DVIWidget::DVIWidget(QWidget* parent, PageView* sv, DocumentPageCache* cache, const char* name) +DVIWidget::DVIWidget(TQWidget* parent, PageView* sv, DocumentPageCache* cache, const char* name) : DocumentWidget(parent, sv, cache, name) { } -void DVIWidget::mousePressEvent(QMouseEvent* e) +void DVIWidget::mousePressEvent(TQMouseEvent* e) { // pageNr == 0 indicated an invalid page (e.g. page number not yet set) if (pageNr == 0) @@ -60,7 +60,7 @@ void DVIWidget::mousePressEvent(QMouseEvent* e) return; } // Remember the closest source link - QPoint center = pageData->sourceHyperLinkList[i].box.center(); + TQPoint center = pageData->sourceHyperLinkList[i].box.center(); int dx = center.x() - e->pos().x(); int dy = center.y() - e->pos().y(); if (dx*dx + dy*dy < minimum || i == 0) @@ -79,7 +79,7 @@ void DVIWidget::mousePressEvent(QMouseEvent* e) } -void DVIWidget::mouseMoveEvent(QMouseEvent* e) +void DVIWidget::mouseMoveEvent(TQMouseEvent* e) { // pageNr == 0 indicated an invalid page (e.g. page number not yet set) if (pageNr == 0) @@ -105,7 +105,7 @@ void DVIWidget::mouseMoveEvent(QMouseEvent* e) // The macro-package srcltx gives a special like "src:99 test.tex" // while MikTeX gives "src:99test.tex". KDVI tries // to understand both. - QString cp = pageData->sourceHyperLinkList[i].linkText; + TQString cp = pageData->sourceHyperLinkList[i].linkText; int max = cp.length(); int i; for(i=0; i -#include +#include #include #include "dvisourcesplitter.h" @@ -16,9 +16,9 @@ //#define DEBUG_SOURCESPLITTER -DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QString &dviFile) +DVI_SourceFileSplitter::DVI_SourceFileSplitter(const TQString &srclink, const TQString &dviFile) { - QString filepart = srclink, linepart; + TQString filepart = srclink, linepart; bool possibleNumberMixUp = false; //if sourcefilename starts with a number //then there could be a mix up, i.e. src:123file.tex //line 123 and file.tex or line 12 and 3file.tex? @@ -48,11 +48,11 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt #endif //test if the file exists - m_fileInfo.setFile(QFileInfo(dviFile).dir(true), filepart); + m_fileInfo.setFile(TQFileInfo(dviFile).dir(true), filepart); bool fiExists = m_fileInfo.exists(); //if it doesn't exist, but adding ".tex" - if ( !fiExists && QFileInfo(m_fileInfo.absFilePath() + ".tex").exists() ) + if ( !fiExists && TQFileInfo(m_fileInfo.absFilePath() + ".tex").exists() ) m_fileInfo.setFile(m_fileInfo.absFilePath() + ".tex"); //if that doesn't help either, perhaps the file started with a @@ -60,8 +60,8 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt //one by one (also try to add .tex repeatedly) if ( possibleNumberMixUp && !fiExists ) { - QFileInfo tempInfo(m_fileInfo); - QString tempFileName = tempInfo.fileName(); + TQFileInfo tempInfo(m_fileInfo); + TQString tempFileName = tempInfo.fileName(); Q_UINT32 index, maxindex = linepart.length(); bool found = false; for ( index = 1; index < maxindex; ++index) diff --git a/kdvi/dvisourcesplitter.h b/kdvi/dvisourcesplitter.h index f0028bf2..5253ce4a 100644 --- a/kdvi/dvisourcesplitter.h +++ b/kdvi/dvisourcesplitter.h @@ -10,24 +10,24 @@ #ifndef DVI_SOURCEFILESPLITTER_H #define DVI_SOURCEFILESPLITTER_H -#include +#include -class QString; +class TQString; class DVI_SourceFileSplitter { public: - DVI_SourceFileSplitter(const QString & scrlink, const QString & dviFile); + DVI_SourceFileSplitter(const TQString & scrlink, const TQString & dviFile); - QString fileName() { return m_fileInfo.fileName(); } - QString filePath() { return m_fileInfo.absFilePath(); } + TQString fileName() { return m_fileInfo.fileName(); } + TQString filePath() { return m_fileInfo.absFilePath(); } bool fileExists() { return m_fileInfo.exists(); } Q_UINT32 line() { return m_line; } private: - QFileInfo m_fileInfo; + TQFileInfo m_fileInfo; Q_UINT32 m_line; bool m_exists; }; diff --git a/kdvi/fontEncoding.cpp b/kdvi/fontEncoding.cpp index 0ca83372..9f2d4de2 100644 --- a/kdvi/fontEncoding.cpp +++ b/kdvi/fontEncoding.cpp @@ -10,14 +10,14 @@ #include #include -#include -#include +#include +#include #include "fontEncoding.h" //#define DEBUG_FONTENC -fontEncoding::fontEncoding(const QString &encName) +fontEncoding::fontEncoding(const TQString &encName) { #ifdef DEBUG_FONTENC kdDebug(4300) << "fontEncoding( " << encName << " )" << endl; @@ -26,7 +26,7 @@ fontEncoding::fontEncoding(const QString &encName) _isValid = false; // Use kpsewhich to find the encoding file. KProcIO proc; - QString encFileName; + TQString encFileName; proc << "kpsewhich" << encName; if (proc.start(KProcess::Block) == false) { kdError(4300) << "fontEncoding::fontEncoding(...): kpsewhich could not be started." << endl; @@ -36,7 +36,7 @@ fontEncoding::fontEncoding(const QString &encName) encFileName = encFileName.stripWhiteSpace(); if (encFileName.isEmpty()) { - kdError(4300) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName) << endl; + kdError(4300) << TQString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName) << endl; return; } @@ -44,12 +44,12 @@ fontEncoding::fontEncoding(const QString &encName) kdDebug(4300) << "FileName of the encoding: " << encFileName << endl; #endif - QFile file( encFileName ); + TQFile file( encFileName ); if ( file.open( IO_ReadOnly ) ) { - // Read the file (excluding comments) into the QString variable + // Read the file (excluding comments) into the TQString variable // 'fileContent' - QTextStream stream( &file ); - QString fileContent; + TQTextStream stream( &file ); + TQString fileContent; while ( !stream.atEnd() ) fileContent += stream.readLine().section('%', 0, 0); // line of text excluding '\n' until first '%'-sign file.close(); @@ -63,10 +63,10 @@ fontEncoding::fontEncoding(const QString &encName) #endif fileContent = fileContent.section('[', 1, 1).section(']',0,0).simplifyWhiteSpace(); - QStringList glyphNameList = QStringList::split( '/', fileContent ); + TQStringList glyphNameList = TQStringList::split( '/', fileContent ); int i = 0; - for ( QStringList::Iterator it = glyphNameList.begin(); (it != glyphNameList.end())&&(i<256); ++it ) { + for ( TQStringList::Iterator it = glyphNameList.begin(); (it != glyphNameList.end())&&(i<256); ++it ) { glyphNameVector[i] = (*it).simplifyWhiteSpace(); #ifdef DEBUG_FONTENC kdDebug(4300) << i << ": " << glyphNameVector[i] << endl; @@ -76,7 +76,7 @@ fontEncoding::fontEncoding(const QString &encName) for(; i<256; i++) glyphNameVector[i] = ".notdef"; } else { - kdError(4300) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName) << endl; + kdError(4300) << TQString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName) << endl; return; } diff --git a/kdvi/fontEncoding.h b/kdvi/fontEncoding.h index b5ca1344..8ce0d18b 100644 --- a/kdvi/fontEncoding.h +++ b/kdvi/fontEncoding.h @@ -9,7 +9,7 @@ #ifndef _FONTENCODING_H #define _FONTENCODING_H -#include +#include /** @@ -63,15 +63,15 @@ class fontEncoding { // located, opened or parsed, errors are printed using the kdError() // channel, and the array glyphNameVector will contain empty // strings. - fontEncoding(const QString &encName); + fontEncoding(const TQString &encName); // Full name of the encoding, as read from the encoding file - QString encodingFullName; + TQString encodingFullName; // List of 256 glyph names. The name can be '.notdef' to indicate // that a certain position is left open, or empty, if the encoding // file did not contain 256 characters or could not be properly read - QString glyphNameVector[256]; + TQString glyphNameVector[256]; // Returns 'true' if the encoding file was found and could // successfully be loaded. diff --git a/kdvi/fontEncodingPool.cpp b/kdvi/fontEncodingPool.cpp index 0100ee90..59b38167 100644 --- a/kdvi/fontEncodingPool.cpp +++ b/kdvi/fontEncodingPool.cpp @@ -16,7 +16,7 @@ fontEncodingPool::fontEncodingPool() } -fontEncoding *fontEncodingPool::findByName(const QString &name) +fontEncoding *fontEncodingPool::findByName(const TQString &name) { fontEncoding *ptr = dictionary.find( name ); diff --git a/kdvi/fontEncodingPool.h b/kdvi/fontEncodingPool.h index b875bf52..05736137 100644 --- a/kdvi/fontEncodingPool.h +++ b/kdvi/fontEncodingPool.h @@ -11,19 +11,19 @@ #include "fontEncoding.h" -#include +#include -class QString; +class TQString; class fontEncodingPool { public: fontEncodingPool(); - fontEncoding *findByName(const QString &name); + fontEncoding *findByName(const TQString &name); private: - QDict dictionary; + TQDict dictionary; }; #endif diff --git a/kdvi/fontMap.cpp b/kdvi/fontMap.cpp index cf5fa841..66d230d7 100644 --- a/kdvi/fontMap.cpp +++ b/kdvi/fontMap.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include "fontMap.h" @@ -38,7 +38,7 @@ fontMap::fontMap() return; } - QString map_fileName; + TQString map_fileName; proc.readln(map_fileName); map_fileName = map_fileName.stripWhiteSpace(); if (map_fileName.isEmpty()) { @@ -59,19 +59,19 @@ fontMap::fontMap() } } - QFile file( map_fileName ); + TQFile file( map_fileName ); if ( file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); - QString line; + TQTextStream stream( &file ); + TQString line; while ( !stream.atEnd() ) { line = stream.readLine().simplifyWhiteSpace(); if (line.at(0) == '%') continue; - QString TeXName = line.section(' ', 0, 0); - QString FullName = line.section(' ', 1, 1); - QString fontFileName = line.section('<', -1).stripWhiteSpace().section(' ', 0, 0); - QString encodingName = line.section('<', -2, -2).stripWhiteSpace().section(' ', 0, 0); + TQString TeXName = line.section(' ', 0, 0); + TQString FullName = line.section(' ', 1, 1); + TQString fontFileName = line.section('<', -1).stripWhiteSpace().section(' ', 0, 0); + TQString encodingName = line.section('<', -2, -2).stripWhiteSpace().section(' ', 0, 0); // It seems that sometimes the encoding is prepended by the // letter '[', which we ignore if ((!encodingName.isEmpty()) && (encodingName[0] == '[')) @@ -81,7 +81,7 @@ fontMap::fontMap() int i = line.find("SlantFont"); if (i >= 0) { bool ok; - slant = line.left(i).section(' ', -1, -1 ,QString::SectionSkipEmpty).toDouble(&ok); + slant = line.left(i).section(' ', -1, -1 ,TQString::SectionSkipEmpty).toDouble(&ok); if (ok == false) slant = 0.0; } @@ -94,15 +94,15 @@ fontMap::fontMap() if (encodingName.endsWith(".enc")) entry.fontEncoding = encodingName; else - entry.fontEncoding = QString::null; + entry.fontEncoding = TQString::null; } file.close(); } else - kdError(4300) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl; + kdError(4300) << TQString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl; #ifdef DEBUG_FONTMAP kdDebug(4300) << "FontMap file parsed. Results:" << endl; - QMap::Iterator it; + TQMap::Iterator it; for ( it = fontMapEntries.begin(); it != fontMapEntries.end(); ++it ) kdDebug(4300) << "TeXName: " << it.key() << ", FontFileName=" << it.data().fontFileName @@ -113,42 +113,42 @@ fontMap::fontMap() } -const QString &fontMap::findFileName(const QString &TeXName) +const TQString &fontMap::findFileName(const TQString &TeXName) { - QMap::Iterator it = fontMapEntries.find(TeXName); + TQMap::Iterator it = fontMapEntries.find(TeXName); if (it != fontMapEntries.end()) return it.data().fontFileName; else - return QString::null; + return TQString::null; } -const QString &fontMap::findFontName(const QString &TeXName) +const TQString &fontMap::findFontName(const TQString &TeXName) { - QMap::Iterator it = fontMapEntries.find(TeXName); + TQMap::Iterator it = fontMapEntries.find(TeXName); if (it != fontMapEntries.end()) return it.data().fullFontName; else - return QString::null; + return TQString::null; } -const QString &fontMap::findEncoding(const QString &TeXName) +const TQString &fontMap::findEncoding(const TQString &TeXName) { - QMap::Iterator it = fontMapEntries.find(TeXName); + TQMap::Iterator it = fontMapEntries.find(TeXName); if (it != fontMapEntries.end()) return it.data().fontEncoding; else - return QString::null; + return TQString::null; } -double fontMap::findSlant(const QString &TeXName) +double fontMap::findSlant(const TQString &TeXName) { - QMap::Iterator it = fontMapEntries.find(TeXName); + TQMap::Iterator it = fontMapEntries.find(TeXName); if (it != fontMapEntries.end()) return it.data().slant; diff --git a/kdvi/fontMap.h b/kdvi/fontMap.h index 55e44082..3e0177a8 100644 --- a/kdvi/fontMap.h +++ b/kdvi/fontMap.h @@ -9,8 +9,8 @@ #ifndef _FONTMAP_H #define _FONTMAP_H -#include -#include +#include +#include /** * This class represents one line of a font map file, and contains @@ -25,18 +25,18 @@ class fontMapEntry { // File name of the font WITHOUT the path. The full path name must // be looked by using the kpathsea library, e.g. by means of the // kpsewhich command. A valid entry would be 'ubkd8a.pfb' - QString fontFileName; + TQString fontFileName; // This string contains the full name of the font, // e.g. 'URWBookmanL-DemiBold' - QString fullFontName; + TQString fullFontName; // If the font requires an encoding (see fontEncoding.h for an // explanation), this string is not empty and contains the name of // the encoding, e.g. '8r'. The path of the associated encoding file // (on the author's machine: /usr/share/texmf/dvips/psnfss/8r.enc) // must be looked up using the kpsewhich comman. - QString fontEncoding; + TQString fontEncoding; // Some fonts need to be slanted, and the font map file defines by // how much. This field is set to 0.0 if no slanting is specified in @@ -92,27 +92,27 @@ class fontMap { /** find the name of a font file (e.g. 'ubkd8a.pfb') from a TeX font name (e.g. 'rpbkd'). This method return a reference to - QString::null if the font could not be found. */ - const QString &findFileName(const QString &TeXName); + TQString::null if the font could not be found. */ + const TQString &findFileName(const TQString &TeXName); /** find the name of a font (e.g. 'URWBookmanL-DemiBold') from a TeX font name (e.g. 'rpbkd'). This method return a reference to - QString::null if the font could not be found. */ - const QString &findFontName(const QString &TeXName); + TQString::null if the font could not be found. */ + const TQString &findFontName(const TQString &TeXName); /** find the name of an encoding file for a font (e.g. '8r') from a TeX font name (e.g. 'rpbkd'). This method return a reference to - QString::null if the font could not be found. */ - const QString &findEncoding(const QString &TeXName); + TQString::null if the font could not be found. */ + const TQString &findEncoding(const TQString &TeXName); /** This method finds the slant of a font. Returns 0.0 if no slant was defined. */ - double findSlant(const QString &TeXName); + double findSlant(const TQString &TeXName); private: /** This member maps TeX font names mapEntry classes that contain the font's filenames, full font names and encodings. */ - QMap fontMapEntries; + TQMap fontMapEntries; }; #endif // ifndef _FONTMAP_H diff --git a/kdvi/fontpool.cpp b/kdvi/fontpool.cpp index adec497b..fecd2b0b 100644 --- a/kdvi/fontpool.cpp +++ b/kdvi/fontpool.cpp @@ -13,10 +13,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include "fontpool.h" @@ -35,7 +35,7 @@ //const int MFResolutions[] = { 300, 600, 1200 }; #ifdef PERFORMANCE_MEASUREMENT -QTime fontPoolTimer; +TQTime fontPoolTimer; bool fontPoolTimerFlag; #endif @@ -60,7 +60,7 @@ fontPool::fontPool() displayResolution_in_dpi = 100.0; // A not-too-bad-default useFontHints = true; CMperDVIunit = 0; - extraSearchPath = QString::null; + extraSearchPath = TQString::null; fontList.setAutoDelete(true); @@ -78,14 +78,14 @@ fontPool::fontPool() // of QT at compile and runtime or the availability of the XFt // extension, alpha channels are either supported, or silently // converted to 1-bit masks. - QImage start(1, 1, 32); // Generate a 1x1 image, black with alpha=0x10 + TQImage start(1, 1, 32); // Generate a 1x1 image, black with alpha=0x10 start.setAlphaBuffer(true); Q_UINT32 *destScanLine = (Q_UINT32 *)start.scanLine(0); *destScanLine = 0x80000000; - QPixmap intermediate(start); - QPixmap dest(1,1); + TQPixmap intermediate(start); + TQPixmap dest(1,1); dest.fill(Qt::white); - QPainter paint( &dest ); + TQPainter paint( &dest ); paint.drawPixmap(0, 0, intermediate); paint.end(); start = dest.convertToImage().convertDepth(32); @@ -93,12 +93,12 @@ fontPool::fontPool() if ((result == 0xff) || (result == 0x00)) { #ifdef DEBUG_FONTPOOL - kdDebug(4300) << "fontPool::fontPool(): QPixmap does not support the alpha channel" << endl; + kdDebug(4300) << "fontPool::fontPool(): TQPixmap does not support the alpha channel" << endl; #endif QPixmapSupportsAlpha = false; } else { #ifdef DEBUG_FONTPOOL - kdDebug(4300) << "fontPool::fontPool(): QPixmap supports the alpha channel" << endl; + kdDebug(4300) << "fontPool::fontPool(): TQPixmap supports the alpha channel" << endl; #endif QPixmapSupportsAlpha = true; } @@ -137,7 +137,7 @@ void fontPool::setParameters( bool _useFontHints ) } -TeXFontDefinition* fontPool::appendx(const QString& fontname, Q_UINT32 checksum, Q_UINT32 scale, double enlargement) +TeXFontDefinition* fontPool::appendx(const TQString& fontname, Q_UINT32 checksum, Q_UINT32 scale, double enlargement) { // Reuse font if possible: check if a font with that name and // natural resolution is already in the fontpool, and use that, if @@ -173,20 +173,20 @@ TeXFontDefinition* fontPool::appendx(const QString& fontname, Q_UINT32 checksum, } -QString fontPool::status() +TQString fontPool::status() { #ifdef DEBUG_FONTPOOL kdDebug(4300) << "fontPool::status() called" << endl; #endif - QString text; - QStringList tmp; + TQString text; + TQStringList tmp; if (fontList.isEmpty()) return i18n("The fontlist is currently empty."); text.append(""); - text.append( QString("") + text.append( TQString("") .arg(i18n("TeX Name")) .arg(i18n("Family")) .arg(i18n("Zoom")) @@ -196,7 +196,7 @@ QString fontPool::status() TeXFontDefinition *fontp = fontList.first(); while ( fontp != 0 ) { - QString errMsg, encoding; + TQString errMsg, encoding; if (!(fontp->flags & TeXFontDefinition::FONT_VIRTUAL)) { #ifdef HAVE_FREETYPE @@ -209,7 +209,7 @@ QString fontPool::status() } #ifdef HAVE_FREETYPE - tmp << QString ("") + tmp << TQString ("") .arg(fontp->fontname) .arg(fontp->getFullFontName()) .arg((int)(fontp->enlargement*100 + 0.5)) @@ -252,7 +252,7 @@ bool fontPool::areFontsLocated() void fontPool::locateFonts() { - kpsewhichOutput = QString::null; + kpsewhichOutput = TQString::null; // First, we try and find those fonts which exist on disk // already. If virtual fonts are found, they will add new fonts to @@ -280,7 +280,7 @@ void fontPool::locateFonts() // present an error message to the user. if (!areFontsLocated()) { markFontsAsLocated(); - QString details = QString("

PATH: %1

%2
").arg(getenv("PATH")).arg(kpsewhichOutput); + TQString details = TQString("

PATH: %1

%2
").arg(getenv("PATH")).arg(kpsewhichOutput); KMessageBox::detailedError( 0, i18n("

KDVI was not able to locate all the font files " "which are necessary to display the current DVI file. " "Your document might be unreadable.

"), @@ -298,14 +298,14 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo // enabled globally. emit setStatusBarText(i18n("Locating fonts...")); - QStringList shellProcessCmdLine; + TQStringList shellProcessCmdLine; KProcIO kpsewhichIO; // If PK fonts are generated, the kpsewhich command will re-route // the output of MetaFont into its stderr. Here we make sure this // output is intercepted and parsed. - qApp->connect(&kpsewhichIO, SIGNAL(receivedStderr(KProcess *, char *, int)), - this, SLOT(mf_output_receiver(KProcess *, char *, int))); + qApp->connect(&kpsewhichIO, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), + this, TQT_SLOT(mf_output_receiver(KProcess *, char *, int))); kpsewhichIO.setUseShell(true); @@ -313,8 +313,8 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo // Now generate the command line for the kpsewhich // program. Unfortunately, this can be rather long and involved... shellProcessCmdLine += "kpsewhich"; - shellProcessCmdLine += QString("--dpi 1200"); - shellProcessCmdLine += QString("--mode lexmarks"); + shellProcessCmdLine += TQString("--dpi 1200"); + shellProcessCmdLine += TQString("--mode lexmarks"); // Disable automatic pk-font generation. if (makePK == true) @@ -330,17 +330,17 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo numFontsInJob++; if (locateTFMonly == true) - shellProcessCmdLine += KShellProcess::quote(QString("%1.tfm").arg(fontp->fontname)); + shellProcessCmdLine += KShellProcess::quote(TQString("%1.tfm").arg(fontp->fontname)); else { #ifdef HAVE_FREETYPE if (FreeType_could_be_loaded == true) { - const QString &filename = fontsByTeXName.findFileName(fontp->fontname); + const TQString &filename = fontsByTeXName.findFileName(fontp->fontname); if (!filename.isEmpty()) - shellProcessCmdLine += KShellProcess::quote(QString("%1").arg(filename)); + shellProcessCmdLine += KShellProcess::quote(TQString("%1").arg(filename)); } #endif - shellProcessCmdLine += KShellProcess::quote(QString("%1.vf").arg(fontp->fontname)); - shellProcessCmdLine += KShellProcess::quote(QString("%1.1200pk").arg(fontp->fontname)); + shellProcessCmdLine += KShellProcess::quote(TQString("%1.vf").arg(fontp->fontname)); + shellProcessCmdLine += KShellProcess::quote(TQString("%1.1200pk").arg(fontp->fontname)); } } fontp=fontList.next(); @@ -352,18 +352,18 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo progress.setTotalSteps(numFontsInJob, &kpsewhichIO); // Now run... kpsewhich. In case of error, kick up a fuss. - MetafontOutput = QString::null; + MetafontOutput = TQString::null; kpsewhichOutput += "

"+shellProcessCmdLine.join(" ")+"

"; kpsewhichIO << shellProcessCmdLine; - QString importanceOfKPSEWHICH = i18n("

KDVI relies on the kpsewhich program to locate font files " + TQString importanceOfKPSEWHICH = i18n("

KDVI relies on the kpsewhich program to locate font files " "on your hard disc and to generate PK fonts, if necessary.

"); if (kpsewhichIO.start(KProcess::NotifyOnExit, false) == false) { - QString msg = i18n( "

The shell process for the kpsewhich program could not " + TQString msg = i18n( "

The shell process for the kpsewhich program could not " "be started. Consequently, some font files could not be found, " "and your document might by unreadable. If this error is reproducable " "please report the issue to the KDVI developers using the 'Help' menu.

" ); - QApplication::restoreOverrideCursor(); - KMessageBox::error( 0, QString("%1%2").arg(importanceOfKPSEWHICH).arg(msg), + TQApplication::restoreOverrideCursor(); + KMessageBox::error( 0, TQString("%1%2").arg(importanceOfKPSEWHICH).arg(msg), i18n("Problem locating fonts - KDVI") ); markFontsAsLocated(); return; @@ -390,8 +390,8 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo if (kpsewhichIO.exitStatus() == 127) { // An exit status of 127 means that the kpsewhich executable // could not be found. We give extra explanation then. - QApplication::restoreOverrideCursor(); - QString msg = i18n( "

There were problems running kpsewhich. As a result, " + TQApplication::restoreOverrideCursor(); + TQString msg = i18n( "

There were problems running kpsewhich. As a result, " "some font files could not be located, and your document might be unreadable.

" "

Possible reason: The kpsewhich program is perhaps not installed on your system, or it " "cannot be found in the current search path.

" @@ -399,9 +399,9 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo "typesetting system. If TeX is not installed on your system, you could install the TeTeX distribution (www.tetex.org). " "If you are sure that TeX is installed, please try to use the kpsewhich program from the command line to check if it " "really works.

"); - QString details = QString("

PATH: %1

%2
").arg(getenv("PATH")).arg(kpsewhichOutput); + TQString details = TQString("

PATH: %1

%2
").arg(getenv("PATH")).arg(kpsewhichOutput); - KMessageBox::detailedError( 0, QString("%1%2").arg(importanceOfKPSEWHICH).arg(msg), details, + KMessageBox::detailedError( 0, TQString("%1%2").arg(importanceOfKPSEWHICH).arg(msg), details, i18n("Problem locating fonts - KDVI") ); // This makes sure the we don't try to run kpsewhich again markFontsAsLocated(); @@ -409,8 +409,8 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo } // Create a list with all filenames found by the kpsewhich program. - QStringList fileNameList; - QString line; + TQStringList fileNameList; + TQString line; while(kpsewhichIO.readln(line) >= 0) fileNameList += line; @@ -418,9 +418,9 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo fontp=fontList.first(); while ( fontp != 0 ) { if (fontp->filename.isEmpty() == true) { - QStringList matchingFiles; + TQStringList matchingFiles; #ifdef HAVE_FREETYPE - const QString &fn = fontsByTeXName.findFileName(fontp->fontname); + const TQString &fn = fontsByTeXName.findFileName(fontp->fontname); if (!fn.isEmpty()) matchingFiles = fileNameList.grep(fn); #endif @@ -431,7 +431,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo #ifdef DEBUG_FONTPOOL kdDebug(4300) << "Associated " << fontp->fontname << " to " << matchingFiles.first() << endl; #endif - QString fname = matchingFiles.first(); + TQString fname = matchingFiles.first(); fontp->fontNameReceiver(fname); fontp->flags |= TeXFontDefinition::FONT_KPSE_NAME; if (fname.endsWith(".vf")) { @@ -550,7 +550,7 @@ void fontPool::mf_output_receiver(KProcess *, char *buffer, int buflen) if (buflen < 0) return; - QString op = QString::fromLocal8Bit(buffer, buflen); + TQString op = TQString::fromLocal8Bit(buffer, buflen); kpsewhichOutput.append(op); MetafontOutput.append(op); @@ -559,7 +559,7 @@ void fontPool::mf_output_receiver(KProcess *, char *buffer, int buflen) int numleft; bool show_prog = false; while( (numleft = MetafontOutput.find('\n')) != -1) { - QString line = MetafontOutput.left(numleft+1); + TQString line = MetafontOutput.left(numleft+1); #ifdef DEBUG_FONTPOOL kdDebug(4300) << "MF OUTPUT RECEIVED: " << line; #endif @@ -575,16 +575,16 @@ void fontPool::mf_output_receiver(KProcess *, char *buffer, int buflen) int startlineindex = line.find("kpathsea:"); if (startlineindex != -1) { int endstartline = line.find("\n",startlineindex); - QString startLine = line.mid(startlineindex,endstartline-startlineindex); + TQString startLine = line.mid(startlineindex,endstartline-startlineindex); // The last word in the startline is the name of the font which we // are generating. The second-to-last word is the resolution in // dots per inch. Display this info in the text label below the // progress bar. int lastblank = startLine.findRev(' '); - QString fontName = startLine.mid(lastblank+1); + TQString fontName = startLine.mid(lastblank+1); int secondblank = startLine.findRev(' ',lastblank-1); - QString dpi = startLine.mid(secondblank+1,lastblank-secondblank-1); + TQString dpi = startLine.mid(secondblank+1,lastblank-secondblank-1); progress.show(); progress.increaseNumSteps( i18n("Currently generating %1 at %2 dpi").arg(fontName).arg(dpi) ); diff --git a/kdvi/fontpool.h b/kdvi/fontpool.h index 2e9d25da..3edcaffe 100644 --- a/kdvi/fontpool.h +++ b/kdvi/fontpool.h @@ -12,8 +12,8 @@ #include "fontprogress.h" #include "TeXFontDefinition.h" -#include -#include +#include +#include #ifdef HAVE_FREETYPE #include @@ -36,7 +36,7 @@ class KShellProcess; * **/ -class fontPool : public QObject { +class fontPool : public TQObject { Q_OBJECT public: @@ -56,12 +56,12 @@ public: current working directory for the kpsewhich command, so that kpsewhich will find fonts that are stored in the DVI file's directory. */ - void setExtraSearchPath( const QString &path ) {extraSearchPath = path;} + void setExtraSearchPath( const TQString &path ) {extraSearchPath = path;} /** Returns the path that is set as the current working directory for the kpsewhich command, so that kpsewhich will find fonts that are stored in the DVI file's directory. */ - QString getExtraSearchPath( ) const {return extraSearchPath;} + TQString getExtraSearchPath( ) const {return extraSearchPath;} /** Sets the resolution of the output device. */ void setDisplayResolution( double _displayResolution_in_dpi ); @@ -78,14 +78,14 @@ public: // called. Since this is done using a concurrently running process, // there is no guarantee that the loading is already performed when // the method returns. - TeXFontDefinition* appendx(const QString& fontname, Q_UINT32 checksum, Q_UINT32 scale, double enlargement); + TeXFontDefinition* appendx(const TQString& fontname, Q_UINT32 checksum, Q_UINT32 scale, double enlargement); // Returns a string in a very basic HTML format which describes the // fonts in the pool. - QString status(); + TQString status(); // This is the list which actually holds pointers to the fonts - QPtrList fontList; + TQPtrList fontList; // This method marks all fonts in the fontpool as "not in use". The // fonts are, however, not removed from memory until the method @@ -131,7 +131,7 @@ public: signals: /** Passed through to the top-level kpart. */ - void setStatusBarText( const QString& ); + void setStatusBarText( const TQString& ); public slots: // Locates font files on the disk using the kpsewhich program. If @@ -177,18 +177,18 @@ private: // virtual font is found, the variable remains untouched. void locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFound=0); - // This QString is used internally by the mf_output_receiver() - // method. This string is set to QString::null in locateFonts(bool, + // This TQString is used internally by the mf_output_receiver() + // method. This string is set to TQString::null in locateFonts(bool, // bool, bool *). Values are set and read by the // mf_output_receiver(...) method - QString MetafontOutput; + TQString MetafontOutput; - // This QString is used to collect the output of kpsewhich and - // MetaFont. The string is set to QString::null in the + // This TQString is used to collect the output of kpsewhich and + // MetaFont. The string is set to TQString::null in the // locateFonts()-method, and content is gathered by the // mf_output_receiver(). This string is used by locateFonts() and // locateFonts(bool, bool, bool *) to display error messages. - QString kpsewhichOutput; + TQString kpsewhichOutput; // This string is set to the DVI file's path. It is used to set the // current working directory for the kpsewhich command, so that @@ -196,7 +196,7 @@ private: // directory. Used by the locateFonts() and the locateFonts(bool, // bool, bool *) method. Values are set by the // setExtraSearchPath(...) method - QString extraSearchPath; + TQString extraSearchPath; // FontProgress; the progress dialog used when generating fonts. fontProgressDialog progress; diff --git a/kdvi/fontprogress.cpp b/kdvi/fontprogress.cpp index 3935ceba..e5e34270 100644 --- a/kdvi/fontprogress.cpp +++ b/kdvi/fontprogress.cpp @@ -11,24 +11,24 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -#include +#include /* * Constructs a fontProgressDialog which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ -fontProgressDialog::fontProgressDialog(const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip, QWidget* parent, const QString& name, bool progressbar) +fontProgressDialog::fontProgressDialog(const TQString& helpIndex, const TQString& label, const TQString& abortTip, const TQString& whatsThis, const TQString& ttip, TQWidget* parent, const TQString& name, bool progressbar) : KDialogBase( parent, "Font Generation Progress Dialog", true, name, Cancel, Cancel, true ) { - setCursor( QCursor( 3 ) ); + setCursor( TQCursor( 3 ) ); setButtonCancel(KGuiItem(i18n("Abort"), "stop", abortTip)); @@ -39,29 +39,29 @@ fontProgressDialog::fontProgressDialog(const QString& helpIndex, const QString& } else enableLinkedHelp(false); - QVBox *page = makeVBoxMainWidget(); + TQVBox *page = makeVBoxMainWidget(); - TextLabel1 = new QLabel( label, page, "TextLabel2" ); - TextLabel1->setAlignment( int( QLabel::AlignCenter ) ); - QWhatsThis::add( TextLabel1, whatsThis ); - QToolTip::add( TextLabel1, ttip ); + TextLabel1 = new TQLabel( label, page, "TextLabel2" ); + TextLabel1->setAlignment( int( TQLabel::AlignCenter ) ); + TQWhatsThis::add( TextLabel1, whatsThis ); + TQToolTip::add( TextLabel1, ttip ); if (progressbar) { ProgressBar1 = new KProgress( page, "ProgressBar1" ); ProgressBar1->setFormat(i18n("%v of %m")); - QWhatsThis::add( ProgressBar1, whatsThis ); - QToolTip::add( ProgressBar1, ttip ); + TQWhatsThis::add( ProgressBar1, whatsThis ); + TQToolTip::add( ProgressBar1, ttip ); } else ProgressBar1 = NULL; - TextLabel2 = new QLabel( "", page, "TextLabel2" ); - TextLabel2->setAlignment( int( QLabel::AlignCenter ) ); - QWhatsThis::add( TextLabel2, whatsThis ); - QToolTip::add( TextLabel2, ttip ); + TextLabel2 = new TQLabel( "", page, "TextLabel2" ); + TextLabel2->setAlignment( int( TQLabel::AlignCenter ) ); + TQWhatsThis::add( TextLabel2, whatsThis ); + TQToolTip::add( TextLabel2, ttip ); progress = 0; procIO = 0; - qApp->connect(this, SIGNAL(finished()), this, SLOT(killProcIO())); + qApp->connect(this, TQT_SIGNAL(finished()), this, TQT_SLOT(killProcIO())); } @@ -75,7 +75,7 @@ fontProgressDialog::~fontProgressDialog() } -void fontProgressDialog::increaseNumSteps(const QString& explanation) +void fontProgressDialog::increaseNumSteps(const TQString& explanation) { if (ProgressBar1 != 0) ProgressBar1->setProgress(progress++); diff --git a/kdvi/fontprogress.h b/kdvi/fontprogress.h index f9c7232b..6f4267cc 100644 --- a/kdvi/fontprogress.h +++ b/kdvi/fontprogress.h @@ -9,11 +9,11 @@ #define FONT_GENERATION_H #include -#include +#include class KProcIO; class KProgress; -class QLabel; +class TQLabel; /** @@ -33,13 +33,13 @@ class fontProgressDialog : public KDialogBase Q_OBJECT public: - fontProgressDialog( const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip, - QWidget* parent = 0, const QString &name = 0, bool progressbar=true ); + fontProgressDialog( const TQString& helpIndex, const TQString& label, const TQString& abortTip, const TQString& whatsThis, const TQString& ttip, + TQWidget* parent = 0, const TQString &name = 0, bool progressbar=true ); ~fontProgressDialog(); /** The number of steps already done is increased, the text received here is analyzed and presented to the user. */ - void increaseNumSteps(const QString& explanation); + void increaseNumSteps(const TQString& explanation); /** Used to initialize the progress bar. If the argument proc is non-zero, the associated process will be killed when the "abort" @@ -47,7 +47,7 @@ public: internally, so it is save to delete the KProcIO anytime. */ void setTotalSteps(int, KProcIO *proc=0); - QLabel* TextLabel2; + TQLabel* TextLabel2; private slots: /** Calling this slot does nothing than to kill the process that is @@ -55,10 +55,10 @@ private slots: void killProcIO(); private: - QLabel* TextLabel1; + TQLabel* TextLabel1; KProgress* ProgressBar1; int progress; - QGuardedPtr procIO; + TQGuardedPtr procIO; }; #endif // FONT_GENERATION_H diff --git a/kdvi/glyph.h b/kdvi/glyph.h index 1cc41823..65f86327 100644 --- a/kdvi/glyph.h +++ b/kdvi/glyph.h @@ -3,8 +3,8 @@ #ifndef _GLYPH_H #define _GLYPH_H -#include -#include +#include +#include struct bitmap { @@ -21,7 +21,7 @@ class glyph { // address of bitmap in font file long addr; - QColor color; + TQColor color; // DVI units to move reference point Q_INT32 dvi_advance_in_units_of_design_size_by_2e20; @@ -29,7 +29,7 @@ class glyph { // x and y offset in pixels short x, y; - QPixmap shrunkenCharacter; + TQPixmap shrunkenCharacter; short x2, y2; /* x and y offset in pixels (shrunken bitmap) */ }; diff --git a/kdvi/infodialog.cpp b/kdvi/infodialog.cpp index f645def8..91de53d3 100644 --- a/kdvi/infodialog.cpp +++ b/kdvi/infodialog.cpp @@ -8,73 +8,73 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "dviFile.h" #include "fontpool.h" #include "infodialog.h" -infoDialog::infoDialog( QWidget* parent ) +infoDialog::infoDialog( TQWidget* parent ) : KDialogBase( Tabbed, i18n("Document Info"), Ok, Ok, parent, "Document Info", false, false) { - QFrame *page1 = addPage( i18n("DVI File") ); - QVBoxLayout *topLayout1 = new QVBoxLayout( page1, 0, 6 ); - TextLabel1 = new QTextView( page1, "TextLabel1" ); - QToolTip::add( TextLabel1, i18n("Information on the currently loaded DVI-file.") ); + TQFrame *page1 = addPage( i18n("DVI File") ); + TQVBoxLayout *topLayout1 = new TQVBoxLayout( page1, 0, 6 ); + TextLabel1 = new TQTextView( page1, "TextLabel1" ); + TQToolTip::add( TextLabel1, i18n("Information on the currently loaded DVI-file.") ); topLayout1->addWidget( TextLabel1 ); - QFrame *page2 = addPage( i18n("Fonts") ); - QVBoxLayout *topLayout2 = new QVBoxLayout( page2, 0, 6 ); - TextLabel2 = new QTextView( page2, "TextLabel1" ); + TQFrame *page2 = addPage( i18n("Fonts") ); + TQVBoxLayout *topLayout2 = new TQVBoxLayout( page2, 0, 6 ); + TextLabel2 = new TQTextView( page2, "TextLabel1" ); TextLabel2->setMinimumWidth(fontMetrics().maxWidth()*40); TextLabel2->setMinimumHeight(fontMetrics().height()*10); - QToolTip::add( TextLabel2, i18n("Information on currently loaded fonts.") ); - QWhatsThis::add( TextLabel2, i18n("This text field shows detailed information about the currently loaded fonts. " + TQToolTip::add( TextLabel2, i18n("Information on currently loaded fonts.") ); + TQWhatsThis::add( TextLabel2, i18n("This text field shows detailed information about the currently loaded fonts. " "This is useful for experts who want to locate problems in the setup of TeX or KDVI.") ); topLayout2->addWidget( TextLabel2 ); - QFrame *page3 = addPage( i18n("External Programs") ); - QVBoxLayout *topLayout3 = new QVBoxLayout( page3, 0, 6 ); - TextLabel3 = new QTextView( page3, "TextLabel1" ); + TQFrame *page3 = addPage( i18n("External Programs") ); + TQVBoxLayout *topLayout3 = new TQVBoxLayout( page3, 0, 6 ); + TextLabel3 = new TQTextView( page3, "TextLabel1" ); TextLabel3->setText( i18n("No output from any external program received.") ); - QToolTip::add( TextLabel3, i18n("Output of external programs.") ); - QWhatsThis::add( TextLabel3, i18n("KDVI uses external programs, such as MetaFont, dvipdfm or dvips. " + TQToolTip::add( TextLabel3, i18n("Output of external programs.") ); + TQWhatsThis::add( TextLabel3, i18n("KDVI uses external programs, such as MetaFont, dvipdfm or dvips. " "This text field shows the output of these programs. " "That is useful for experts who want to find problems in the setup of TeX or KDVI.") ); topLayout3->addWidget( TextLabel3 ); MFOutputReceived = false; - headline = QString::null; - pool = QString::null; + headline = TQString::null; + pool = TQString::null; } void infoDialog::setDVIData(dvifile *dviFile) { - QString text = ""; + TQString text = ""; if (dviFile == NULL) text = i18n("There is no DVI file loaded at the moment."); else { text.append("
%1 %2 %3 %4 %5 %6
%1 %2 %3 %4 %5 %6
%1 %2 %3% %4 %5 %6
%1 %2 %3% %4 %5 %6
"); - text.append(QString("").arg(i18n("Filename")).arg(dviFile->filename)); + text.append(TQString("").arg(i18n("Filename")).arg(dviFile->filename)); - QFile file(dviFile->filename); + TQFile file(dviFile->filename); if (file.exists()) - text.append(QString("").arg(i18n("File Size")).arg(KIO::convertSize(file.size()))); + text.append(TQString("").arg(i18n("File Size")).arg(KIO::convertSize(file.size()))); else - text.append(QString("").arg(i18n("The file does no longer exist."))); + text.append(TQString("").arg(i18n("The file does no longer exist."))); - text.append(QString("")); - text.append(QString("").arg(i18n("#Pages")).arg(dviFile->total_pages)); - text.append(QString("").arg(i18n("Generator/Date")).arg(dviFile->generatorString)); + text.append(TQString("")); + text.append(TQString("").arg(i18n("#Pages")).arg(dviFile->total_pages)); + text.append(TQString("").arg(i18n("Generator/Date")).arg(dviFile->generatorString)); } // else (dviFile == NULL) TextLabel1->setText( text ); @@ -86,23 +86,23 @@ void infoDialog::setFontInfo(fontPool *fp) TextLabel2->setText(fp->status()); } -void infoDialog::outputReceiver(const QString& _op) +void infoDialog::outputReceiver(const TQString& _op) { - QString op = _op; - op = op.replace( QRegExp("<"), "<" ); + TQString op = _op; + op = op.replace( TQRegExp("<"), "<" ); if (MFOutputReceived == false) { TextLabel3->setText(""+headline+"
"); - headline = QString::null; + headline = TQString::null; } - // It seems that the QTextView wants that we append only full lines. + // It seems that the TQTextView wants that we append only full lines. // We see to that. pool = pool+op; int idx = pool.findRev("\n"); while(idx != -1) { - QString line = pool.left(idx); + TQString line = pool.left(idx); pool = pool.mid(idx+1); // If the Output of the kpsewhich program contains a line starting @@ -111,7 +111,7 @@ void infoDialog::outputReceiver(const QString& _op) int startlineindex = line.find("kpathsea:"); if (startlineindex != -1) { int endstartline = line.find("\n",startlineindex); - QString startLine = line.mid(startlineindex,endstartline-startlineindex); + TQString startLine = line.mid(startlineindex,endstartline-startlineindex); if (MFOutputReceived) TextLabel3->append("
\n"+startLine+""); else @@ -125,10 +125,10 @@ void infoDialog::outputReceiver(const QString& _op) MFOutputReceived = true; } -void infoDialog::clear(const QString& op) +void infoDialog::clear(const TQString& op) { headline = op; - pool = QString::null; + pool = TQString::null; MFOutputReceived = false; } #include "infodialog.moc" diff --git a/kdvi/infodialog.h b/kdvi/infodialog.h index 916d0d13..8b3ea7d2 100644 --- a/kdvi/infodialog.h +++ b/kdvi/infodialog.h @@ -9,12 +9,12 @@ #include -#include +#include class dvifile; class fontPool; -class QTextView; -class QWidget; +class TQTextView; +class TQWidget; class infoDialog : public KDialogBase @@ -22,21 +22,21 @@ class infoDialog : public KDialogBase Q_OBJECT public: - infoDialog( QWidget* parent = 0 ); + infoDialog( TQWidget* parent = 0 ); /** This method is used to set the data coming from the DVI file. Note that 0 is a permissible argument, that just means: "no file loaded" */ void setDVIData(dvifile *dviFile); - QTextView* TextLabel1; - QTextView* TextLabel2; - QTextView* TextLabel3; + TQTextView* TextLabel1; + TQTextView* TextLabel2; + TQTextView* TextLabel3; public slots: /** This slot is called when Output from the MetaFont programm is received via the fontpool/kpsewhich */ - void outputReceiver(const QString&); + void outputReceiver(const TQString&); /** This slot is called whenever anything in the fontpool has changed. If the infoDialog is shown, the dialog could then @@ -47,12 +47,12 @@ public slots: headline. The next time output is received via the outputReceiver, the headline is displayed in bold on top of the text view. */ - void clear(const QString&); + void clear(const TQString&); protected: bool MFOutputReceived; - QString headline; - QString pool; + TQString headline; + TQString pool; }; #endif // INFO_KDVI_H diff --git a/kdvi/kdvi_multipage.cpp b/kdvi/kdvi_multipage.cpp index 973e4d5f..8a7b1f59 100644 --- a/kdvi/kdvi_multipage.cpp +++ b/kdvi/kdvi_multipage.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -34,13 +34,13 @@ #include "renderedDocumentPagePixmap.h" -#include +#include //#define KDVI_MULTIPAGE_DEBUG #ifdef PERFORMANCE_MEASUREMENT // These objects are explained in the file "performanceMeasurement.h" -QTime performanceTimer; +TQTime performanceTimer; int performanceFlag = 0; #endif @@ -49,8 +49,8 @@ K_EXPORT_COMPONENT_FACTORY(kdvipart, KDVIMultiPageFactory) -KDVIMultiPage::KDVIMultiPage(QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList& args) +KDVIMultiPage::KDVIMultiPage(TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList& args) : KMultiPage(parentWidget, widgetName, parent, name), DVIRenderer(parentWidget) { Q_UNUSED(args); @@ -67,13 +67,13 @@ KDVIMultiPage::KDVIMultiPage(QWidget *parentWidget, const char *widgetName, QObj DVIRenderer.setName("DVI renderer"); setRenderer(&DVIRenderer); - docInfoAction = new KAction(i18n("Document &Info"), "info", 0, &DVIRenderer, SLOT(showInfo()), actionCollection(), "info_dvi"); - embedPSAction = new KAction(i18n("Embed External PostScript Files..."), 0, this, SLOT(slotEmbedPostScript()), actionCollection(), "embed_postscript"); - new KAction(i18n("Enable All Warnings && Messages"), 0, this, SLOT(doEnableWarnings()), actionCollection(), "enable_msgs"); - exportPSAction = new KAction(i18n("PostScript..."), 0, &DVIRenderer, SLOT(exportPS()), actionCollection(), "export_postscript"); - exportPDFAction = new KAction(i18n("PDF..."), 0, &DVIRenderer, SLOT(exportPDF()), actionCollection(), "export_pdf"); + docInfoAction = new KAction(i18n("Document &Info"), "info", 0, &DVIRenderer, TQT_SLOT(showInfo()), actionCollection(), "info_dvi"); + embedPSAction = new KAction(i18n("Embed External PostScript Files..."), 0, this, TQT_SLOT(slotEmbedPostScript()), actionCollection(), "embed_postscript"); + new KAction(i18n("Enable All Warnings && Messages"), 0, this, TQT_SLOT(doEnableWarnings()), actionCollection(), "enable_msgs"); + exportPSAction = new KAction(i18n("PostScript..."), 0, &DVIRenderer, TQT_SLOT(exportPS()), actionCollection(), "export_postscript"); + exportPDFAction = new KAction(i18n("PDF..."), 0, &DVIRenderer, TQT_SLOT(exportPDF()), actionCollection(), "export_pdf"); - KStdAction::tipOfDay(this, SLOT(showTip()), actionCollection(), "help_tipofday"); + KStdAction::tipOfDay(this, TQT_SLOT(showTip()), actionCollection(), "help_tipofday"); setXMLFile("kdvi_part.rc"); @@ -81,7 +81,7 @@ KDVIMultiPage::KDVIMultiPage(QWidget *parentWidget, const char *widgetName, QObj enableActions(false); // Show tip of the day, when the first main window is shown. - QTimer::singleShot(0,this,SLOT(showTipOnStart())); + TQTimer::singleShot(0,this,TQT_SLOT(showTipOnStart())); } @@ -139,18 +139,18 @@ void KDVIMultiPage::setEmbedPostScriptAction() void KDVIMultiPage::slotSave() { // Try to guess the proper ending... - QString formats; - QString ending; + TQString formats; + TQString ending; int rindex = m_file.findRev("."); if (rindex == -1) { - ending = QString::null; - formats = QString::null; + ending = TQString::null; + formats = TQString::null; } else { ending = m_file.mid(rindex); // e.g. ".dvi" formats = fileFormats().grep(ending).join("\n"); } - QString fileName = KFileDialog::getSaveFileName(QString::null, formats, 0, i18n("Save File As")); + TQString fileName = KFileDialog::getSaveFileName(TQString::null, formats, 0, i18n("Save File As")); if (fileName.isEmpty()) return; @@ -160,7 +160,7 @@ void KDVIMultiPage::slotSave() if (!ending.isEmpty() && fileName.find(ending) == -1) fileName = fileName+ending; - if (QFile(fileName).exists()) { + if (TQFile(fileName).exists()) { int r = KMessageBox::warningContinueCancel (0, i18n("The file %1\nexists. Do you want to overwrite that file?").arg(fileName), i18n("Overwrite File"), i18n("Overwrite")); if (r == KMessageBox::Cancel) @@ -190,9 +190,9 @@ void KDVIMultiPage::setFile(bool r) } -QStringList KDVIMultiPage::fileFormats() const +TQStringList KDVIMultiPage::fileFormats() const { - QStringList r; + TQStringList r; r << i18n("*.dvi *.DVI|TeX Device Independent Files (*.dvi)"); return r; } @@ -256,7 +256,7 @@ void KDVIMultiPage::print() // Turn the results of the options requestor into a list arguments // which are used by dvips. - QString dvips_options = QString::null; + TQString dvips_options = TQString::null; // Print in reverse order. if ( printer->pageOrder() == KPrinter::LastPageFirst ) dvips_options += "-r "; @@ -371,15 +371,15 @@ void KDVIMultiPage::print() // List of pages to print. - QValueList pageList = printer->pageList(); + TQValueList pageList = printer->pageList(); dvips_options += "-pp "; int commaflag = 0; - for( QValueList::ConstIterator it = pageList.begin(); it != pageList.end(); ++it ) { + for( TQValueList::ConstIterator it = pageList.begin(); it != pageList.end(); ++it ) { if (commaflag == 1) - dvips_options += QString(","); + dvips_options += TQString(","); else commaflag = 1; - dvips_options += QString("%1").arg(*it); + dvips_options += TQString("%1").arg(*it); } // Now print. For that, export the DVI-File to PostScript. Note that @@ -435,12 +435,12 @@ DocumentWidget* KDVIMultiPage::createDocumentWidget() "singlePageWidget" ); // Lets not forget the connections we make in the KMultiPage - connect(documentWidget, SIGNAL(clearSelection()), this, SLOT(clearSelection())); - connect(this, SIGNAL(enableMoveTool(bool)), documentWidget, SLOT(slotEnableMoveTool(bool))); + connect(documentWidget, TQT_SIGNAL(clearSelection()), this, TQT_SLOT(clearSelection())); + connect(this, TQT_SIGNAL(enableMoveTool(bool)), documentWidget, TQT_SLOT(slotEnableMoveTool(bool))); // Handle source links - connect(documentWidget, SIGNAL(SRCLink(const QString&, QMouseEvent*, DocumentWidget*)), getRenderer(), - SLOT(handleSRCLink(const QString& ,QMouseEvent*, DocumentWidget*))); + connect(documentWidget, TQT_SIGNAL(SRCLink(const TQString&, TQMouseEvent*, DocumentWidget*)), getRenderer(), + TQT_SLOT(handleSRCLink(const TQString& ,TQMouseEvent*, DocumentWidget*))); return documentWidget; } diff --git a/kdvi/kdvi_multipage.h b/kdvi/kdvi_multipage.h index 713afab7..c3e60aea 100644 --- a/kdvi/kdvi_multipage.h +++ b/kdvi/kdvi_multipage.h @@ -5,7 +5,7 @@ #include "kmultipage.h" #include "dviRenderer.h" -#include +#include class KPrinter; @@ -14,14 +14,14 @@ class KDVIMultiPage : public KMultiPage Q_OBJECT public: - KDVIMultiPage(QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList& args = QStringList()); + KDVIMultiPage(TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList& args = TQStringList()); virtual ~KDVIMultiPage(); // Interface definition start ------------------------------------------------ /// returns the list of supported file formats - virtual QStringList fileFormats() const; + virtual TQStringList fileFormats() const; virtual void setFile(bool r); diff --git a/kdvi/kdvi_multipage_texthandling.cpp b/kdvi/kdvi_multipage_texthandling.cpp index c667584e..dc237da5 100644 --- a/kdvi/kdvi_multipage_texthandling.cpp +++ b/kdvi/kdvi_multipage_texthandling.cpp @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include "kdvi_multipage.h" #include "dviFile.h" diff --git a/kdvi/kprinterwrapper.h b/kdvi/kprinterwrapper.h index 03959361..d7133f03 100644 --- a/kdvi/kprinterwrapper.h +++ b/kdvi/kprinterwrapper.h @@ -16,7 +16,7 @@ class KDVIPrinterWrapper : public KPrinter { public: - KDVIPrinterWrapper() : KPrinter(true, QPrinter::ScreenResolution) {; }; + KDVIPrinterWrapper() : KPrinter(true, TQPrinter::ScreenResolution) {; }; void doPreparePrinting() { preparePrinting(); }; }; diff --git a/kdvi/main.cpp b/kdvi/main.cpp index 4340f0e8..af7bc928 100644 --- a/kdvi/main.cpp +++ b/kdvi/main.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include @@ -77,22 +77,22 @@ int main(int argc, char** argv) if (!url.isValid()) { - kdError(4300) << QString(I18N_NOOP("The URL %1 is not well-formed.")).arg(args->arg(0)) << endl; + kdError(4300) << TQString(I18N_NOOP("The URL %1 is not well-formed.")).arg(args->arg(0)) << endl; return -1; } if (!url.isLocalFile()) { - kdError(4300) << QString(I18N_NOOP("The URL %1 does not point to a local file. You can only specify local " + kdError(4300) << TQString(I18N_NOOP("The URL %1 does not point to a local file. You can only specify local " "files if you are using the '--unique' option.")).arg(args->arg(0)) << endl; return -1; } - QString qualPath = QFileInfo(url.path()).absFilePath(); + TQString qualPath = TQFileInfo(url.path()).absFilePath(); app.dcopClient()->attach(); // We need to register as "kviewshell" to stay compatible with existing DCOP-skripts. - QCString id = app.dcopClient()->registerAs("unique-kviewshell"); + TQCString id = app.dcopClient()->registerAs("unique-kviewshell"); if (id.isNull()) kdError(4300) << "There was an error using dcopClient()->registerAs()." << endl; QCStringList apps = app.dcopClient()->registeredApplications(); @@ -100,22 +100,22 @@ int main(int argc, char** argv) { if ((*it).find("kviewshell") == 0) { - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); bool result; arg << qualPath.stripWhiteSpace(); - if (!app.dcopClient()->call( *it, "kmultipage", "is_file_loaded(QString)", data, replyType, replyData)) + if (!app.dcopClient()->call( *it, "kmultipage", "is_file_loaded(TQString)", data, replyType, replyData)) kdError(4300) << "There was an error using DCOP." << endl; else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if (replyType == "bool") { reply >> result; if (result == true) { - if (app.dcopClient()->send( *it, "kmultipage", "jumpToReference(QString)", url.ref()) == true) + if (app.dcopClient()->send( *it, "kmultipage", "jumpToReference(TQString)", url.ref()) == true) { app.dcopClient()->detach(); return 0; @@ -143,7 +143,7 @@ int main(int argc, char** argv) // If the url doesn't already has a reference part, add the // argument of --goto to the url as reference, to make the // KViewShell jump to this page. - QString reference = args->getOption("goto"); + TQString reference = args->getOption("goto"); url.setHTMLRef(reference); } shell->openURL(url); diff --git a/kdvi/optionDialogFontsWidget.cpp b/kdvi/optionDialogFontsWidget.cpp index a3a76425..14a72ee2 100644 --- a/kdvi/optionDialogFontsWidget.cpp +++ b/kdvi/optionDialogFontsWidget.cpp @@ -12,10 +12,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "fontpool.h" #include "optionDialogFontsWidget.h" @@ -23,7 +23,7 @@ // Constructs a optionDialogWidget_base which is a child of 'parent', with // the name 'name' and widget flags set to 'f'. -optionDialogFontsWidget::optionDialogFontsWidget( QWidget* parent, const char* name, WFlags fl ) +optionDialogFontsWidget::optionDialogFontsWidget( TQWidget* parent, const char* name, WFlags fl ) : optionDialogFontsWidget_base( parent, name, fl ) { #ifndef HAVE_FREETYPE @@ -31,8 +31,8 @@ optionDialogFontsWidget::optionDialogFontsWidget( QWidget* parent, const char* kcfg_UseType1Fonts->setEnabled(false); kcfg_UseFontHints->setEnabled(false); kcfg_UseFontHints->setChecked(false); - QToolTip::add(PFB_ButtonGroup, i18n("This version of KDVI does not support type 1 fonts.")); - QWhatsThis::add(PFB_ButtonGroup, i18n("KDVI needs the FreeType library to access type 1 fonts. This library " + TQToolTip::add(PFB_ButtonGroup, i18n("This version of KDVI does not support type 1 fonts.")); + TQWhatsThis::add(PFB_ButtonGroup, i18n("KDVI needs the FreeType library to access type 1 fonts. This library " "was not present when KDVI was compiled. If you want to use type 1 " "fonts, you must either install the FreeType library and recompile KDVI " "yourself, or find a precompiled software package for your operating " diff --git a/kdvi/optionDialogFontsWidget.h b/kdvi/optionDialogFontsWidget.h index 63ce98cc..f7ad740f 100644 --- a/kdvi/optionDialogFontsWidget.h +++ b/kdvi/optionDialogFontsWidget.h @@ -17,7 +17,7 @@ class optionDialogFontsWidget : public optionDialogFontsWidget_base Q_OBJECT public: - optionDialogFontsWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + optionDialogFontsWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~optionDialogFontsWidget(); }; diff --git a/kdvi/optionDialogSpecialWidget.cpp b/kdvi/optionDialogSpecialWidget.cpp index e93cdc70..1b61e4a5 100644 --- a/kdvi/optionDialogSpecialWidget.cpp +++ b/kdvi/optionDialogSpecialWidget.cpp @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include "optionDialogSpecialWidget.h" #include "prefs.h" @@ -25,7 +25,7 @@ // Constructs a optionDialogWidget_base which is a child of 'parent', with // the name 'name' and widget flags set to 'f'. -optionDialogSpecialWidget::optionDialogSpecialWidget( QWidget* parent, const char* name, WFlags fl ) +optionDialogSpecialWidget::optionDialogSpecialWidget( TQWidget* parent, const char* name, WFlags fl ) : optionDialogSpecialWidget_base( parent, name, fl ) { // Set up the list of known and supported editors @@ -64,7 +64,7 @@ optionDialogSpecialWidget::optionDialogSpecialWidget( QWidget* parent, const ch // not recognized, switch to "User defined editor". That way, kdvi // stays compatible even if the EditorCommands[] change between // different versions of kdvi. - QString currentEditorCommand = Prefs::editorCommand(); + TQString currentEditorCommand = Prefs::editorCommand(); int i; for(i = editorCommandString.count()-1; i>0; i--) if (editorCommandString[i] == currentEditorCommand) @@ -73,28 +73,28 @@ optionDialogSpecialWidget::optionDialogSpecialWidget( QWidget* parent, const ch usersEditorCommand = currentEditorCommand; slotComboBox(i); - connect(urll, SIGNAL(leftClickedURL(const QString&)), this, SLOT(slotExtraHelpButton(const QString&))); - connect(editorChoice, SIGNAL( activated( int ) ), this, SLOT( slotComboBox( int ) ) ); + connect(urll, TQT_SIGNAL(leftClickedURL(const TQString&)), this, TQT_SLOT(slotExtraHelpButton(const TQString&))); + connect(editorChoice, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotComboBox( int ) ) ); // Editor description strings (and their translations) vary in // size. Find the longest description string available to make sure // that the page is always large enough. int maximumWidth = 0; - for ( QStringList::Iterator it = editorDescriptionString.begin(); it != editorDescriptionString.end(); ++it ) { + for ( TQStringList::Iterator it = editorDescriptionString.begin(); it != editorDescriptionString.end(); ++it ) { int width = editorDescription->fontMetrics().width(*it); if (width > maximumWidth) maximumWidth = width; } editorDescription->setMinimumWidth(maximumWidth+10); - connect(kcfg_EditorCommand, SIGNAL( textChanged (const QString &) ), this, SLOT( slotUserDefdEditorCommand( const QString & ) ) ); + connect(kcfg_EditorCommand, TQT_SIGNAL( textChanged (const TQString &) ), this, TQT_SLOT( slotUserDefdEditorCommand( const TQString & ) ) ); } optionDialogSpecialWidget::~optionDialogSpecialWidget() { } -void optionDialogSpecialWidget::slotUserDefdEditorCommand( const QString &text ) +void optionDialogSpecialWidget::slotUserDefdEditorCommand( const TQString &text ) { if (isUserDefdEditor == true) EditorCommand = usersEditorCommand = text; @@ -121,7 +121,7 @@ void optionDialogSpecialWidget::slotComboBox(int item) } } -void optionDialogSpecialWidget::slotExtraHelpButton( const QString & ) +void optionDialogSpecialWidget::slotExtraHelpButton( const TQString & ) { kapp->invokeHelp( "inv-search", "kdvi" ); } diff --git a/kdvi/optionDialogSpecialWidget.h b/kdvi/optionDialogSpecialWidget.h index cdd81100..0bdca8dd 100644 --- a/kdvi/optionDialogSpecialWidget.h +++ b/kdvi/optionDialogSpecialWidget.h @@ -17,20 +17,20 @@ class optionDialogSpecialWidget : public optionDialogSpecialWidget_base Q_OBJECT public: - optionDialogSpecialWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + optionDialogSpecialWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~optionDialogSpecialWidget(); public slots: void apply(); void slotComboBox(int item); - void slotUserDefdEditorCommand( const QString &text ); - void slotExtraHelpButton( const QString &anchor); + void slotUserDefdEditorCommand( const TQString &text ); + void slotExtraHelpButton( const TQString &anchor); private: - QStringList editorNameString, editorCommandString, editorDescriptionString; - QString EditorCommand; + TQStringList editorNameString, editorCommandString, editorDescriptionString; + TQString EditorCommand; bool isUserDefdEditor; - QString usersEditorCommand; + TQString usersEditorCommand; }; #endif // OPTIONDIALOGSPECIALWIDGET_H diff --git a/kdvi/performanceMeasurement.h b/kdvi/performanceMeasurement.h index b6cb46c7..d7e4c9b4 100644 --- a/kdvi/performanceMeasurement.h +++ b/kdvi/performanceMeasurement.h @@ -3,13 +3,13 @@ //#define PERFORMANCE_MEASUREMENT #ifdef PERFORMANCE_MEASUREMENT -#include +#include // This is the central timer used for performance measurement. It is // set to zero and started when the kdvi_multipage is // constructed. This object is statically defined in // kdvi_multipage.cpp. -extern QTime performanceTimer; +extern TQTime performanceTimer; // A flag that is set to true once the first page of the document was // successfully drawn. This object is statically defined in diff --git a/kdvi/prebookmark.h b/kdvi/prebookmark.h index 141c8d6c..ef637a60 100644 --- a/kdvi/prebookmark.h +++ b/kdvi/prebookmark.h @@ -23,7 +23,7 @@ #ifndef _PREBOOKMARK_H_ #define _PREBOOKMARK_H_ -#include +#include /*! \brief Bookmark representation @@ -34,14 +34,14 @@ the DVI prescan routines. class PreBookmark { public: - PreBookmark(const QString& t, const QString& a, Q_UINT16 n) {title=t; anchorName=a; noOfChildren=n;} - PreBookmark() {title=QString::null; anchorName=QString::null; noOfChildren=0;} + PreBookmark(const TQString& t, const TQString& a, Q_UINT16 n) {title=t; anchorName=a; noOfChildren=n;} + PreBookmark() {title=TQString::null; anchorName=TQString::null; noOfChildren=0;} // Title of the bookmark - QString title; + TQString title; // Name of the anchor - QString anchorName; + TQString anchorName; // Number of subordinate bookmarks Q_UINT16 noOfChildren; diff --git a/kdvi/psgs.cpp b/kdvi/psgs.cpp index 9e23fcad..2c745a7c 100644 --- a/kdvi/psgs.cpp +++ b/kdvi/psgs.cpp @@ -14,8 +14,8 @@ #include #include #include -#include -#include +#include +#include #include "psgs.h" #include "dviFile.h" @@ -26,8 +26,8 @@ extern const char psheader[]; //#define DEBUG_PSGS -pageInfo::pageInfo(const QString& _PostScriptString) { - PostScriptString = new QString(_PostScriptString); +pageInfo::pageInfo(const TQString& _PostScriptString) { + PostScriptString = new TQString(_PostScriptString); background = Qt::white; permanentBackground = Qt::white; } @@ -44,7 +44,7 @@ pageInfo::~pageInfo() { ghostscript_interface::ghostscript_interface() { pageList.setAutoDelete(true); - PostScriptHeaderString = new QString(); + PostScriptHeaderString = new TQString(); knownDevices.append("png256"); knownDevices.append("jpeg"); @@ -59,7 +59,7 @@ ghostscript_interface::~ghostscript_interface() { } -void ghostscript_interface::setPostScript(const PageNumber& page, const QString& PostScript) { +void ghostscript_interface::setPostScript(const PageNumber& page, const TQString& PostScript) { #ifdef DEBUG_PSGS kdDebug(4300) << "ghostscript_interface::setPostScript( " << page << ", ... )" << endl; #endif @@ -75,7 +75,7 @@ void ghostscript_interface::setPostScript(const PageNumber& page, const QString& } -void ghostscript_interface::setIncludePath(const QString &_includePath) { +void ghostscript_interface::setIncludePath(const TQString &_includePath) { if (_includePath.isEmpty()) includePath = "*"; // Allow all files else @@ -83,13 +83,13 @@ void ghostscript_interface::setIncludePath(const QString &_includePath) { } -void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QColor& background_color, bool permanent) { +void ghostscript_interface::setBackgroundColor(const PageNumber& page, const TQColor& background_color, bool permanent) { #ifdef DEBUG_PSGS kdDebug(4300) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )" << endl; #endif if (pageList.find(page) == 0) { - pageInfo *info = new pageInfo(QString::null); + pageInfo *info = new pageInfo(TQString::null); info->background = background_color; if (permanent) info->permanentBackground = background_color; @@ -119,7 +119,7 @@ void ghostscript_interface::restoreBackgroundColor(const PageNumber& page) // Returns the background color for a certain page. This color is // always guaranteed to be valid -QColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const { +TQColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const { #ifdef DEBUG_PSGS kdDebug(4300) << "ghostscript_interface::getBackgroundColor( " << page << " )" << endl; #endif @@ -139,7 +139,7 @@ void ghostscript_interface::clear() { } -void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, const QString& filename, long magnification) { +void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, const TQString& filename, long magnification) { #ifdef DEBUG_PSGS kdDebug(4300) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )" << endl; #endif @@ -155,9 +155,9 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co // Generate a PNG-file // Step 1: Write the PostScriptString to a File - KTempFile PSfile(QString::null,".ps"); + KTempFile PSfile(TQString::null,".ps"); - QTextStream& os = *PSfile.textStream(); + TQTextStream& os = *PSfile.textStream(); os << "%!PS-Adobe-2.0\n" << "%%Creator: kdvi\n" << "%%Title: KDVI temporary PostScript\n" @@ -190,7 +190,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co os << PostScriptHeaderString->latin1(); if (info->background != Qt::white) { - QString colorCommand = QString("gsave %1 %2 %3 setrgbcolor clippath fill grestore\n"). + TQString colorCommand = TQString("gsave %1 %2 %3 setrgbcolor clippath fill grestore\n"). arg(info->background.red()/255.0). arg(info->background.green()/255.0). arg(info->background.blue()/255.0); @@ -206,16 +206,16 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co PSfile.close(); // Step 2: Call GS with the File - QFile::remove(filename.ascii()); + TQFile::remove(filename.ascii()); KProcIO proc; - QStringList argus; + TQStringList argus; argus << "gs"; argus << "-dSAFER" << "-dPARANOIDSAFER" << "-dDELAYSAFER" << "-dNOPAUSE" << "-dBATCH"; - argus << QString("-sDEVICE=%1").arg(*gsDevice); - argus << QString("-sOutputFile=%1").arg(filename); - argus << QString("-sExtraIncludePath=%1").arg(includePath); - argus << QString("-g%1x%2").arg(pixel_page_w).arg(pixel_page_h); // page size in pixels - argus << QString("-r%1").arg(resolution); // resolution in dpi + argus << TQString("-sDEVICE=%1").arg(*gsDevice); + argus << TQString("-sOutputFile=%1").arg(filename); + argus << TQString("-sExtraIncludePath=%1").arg(includePath); + argus << TQString("-g%1x%2").arg(pixel_page_w).arg(pixel_page_h); // page size in pixels + argus << TQString("-r%1").arg(resolution); // resolution in dpi argus << "-c" << "<< /PermitFileReading [ ExtraIncludePath ] /PermitFileWriting [] /PermitFileControl [] >> setuserparams .locksafe"; argus << "-f" << PSfile.name(); @@ -232,15 +232,15 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co PSfile.unlink(); // Check if gs has indeed produced a file. - if (QFile::exists(filename) == false) { + if (TQFile::exists(filename) == false) { kdError(4300) << "GS did not produce output." << endl; // No. Check is the reason is that the device is not compiled into // ghostscript. If so, try again with another device. - QString GSoutput; + TQString GSoutput; while(proc.readln(GSoutput) != -1) { if (GSoutput.contains("Unknown device")) { - kdDebug(4300) << QString("The version of ghostview installed on this computer does not support " + kdDebug(4300) << TQString("The version of ghostview installed on this computer does not support " "the '%1' ghostview device driver.").arg(*gsDevice) << endl; knownDevices.remove(gsDevice); gsDevice = knownDevices.begin(); @@ -267,24 +267,24 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co "drivers. Note that KDVI needs to be restarted to re-enable PostScript support." "

")); else { - kdDebug(4300) << QString("KDVI will now try to use the '%1' device driver.").arg(*gsDevice) << endl; + kdDebug(4300) << TQString("KDVI will now try to use the '%1' device driver.").arg(*gsDevice) << endl; gs_generate_graphics_file(page, filename, magnification); } return; } } } - emit(setStatusBarText(QString::null)); + emit(setStatusBarText(TQString::null)); } -void ghostscript_interface::graphics(const PageNumber& page, double dpi, long magnification, QPainter* paint) { +void ghostscript_interface::graphics(const PageNumber& page, double dpi, long magnification, TQPainter* paint) { #ifdef DEBUG_PSGS kdDebug(4300) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called." << endl; #endif if (paint == 0) { - kdError(4300) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, QPainter *paint) called with paint == 0" << endl; + kdError(4300) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, TQPainter *paint) called with paint == 0" << endl; return; } @@ -303,32 +303,32 @@ void ghostscript_interface::graphics(const PageNumber& page, double dpi, long ma return; } - KTempFile gfxFile(QString::null, ".png"); + KTempFile gfxFile(TQString::null, ".png"); gfxFile.setAutoDelete(1); gfxFile.close(); // we are want the filename, not the file gs_generate_graphics_file(page, gfxFile.name(), magnification); - QPixmap MemoryCopy(gfxFile.name()); + TQPixmap MemoryCopy(gfxFile.name()); paint->drawPixmap(0, 0, MemoryCopy); return; } -QString ghostscript_interface::locateEPSfile(const QString &filename, const KURL &base) +TQString ghostscript_interface::locateEPSfile(const TQString &filename, const KURL &base) { // If the base URL indicates that the DVI file is local, try to find // the graphics file in the directory where the DVI file resides if (base.isLocalFile()) { - QString path = base.path(); // -> "/bar/foo.dvi" - QFileInfo fi1(path); - QFileInfo fi2(fi1.dir(),filename); + TQString path = base.path(); // -> "/bar/foo.dvi" + TQFileInfo fi1(path); + TQFileInfo fi2(fi1.dir(),filename); if (fi2.exists()) return fi2.absFilePath(); } // Otherwise, use kpsewhich to find the eps file. - QString EPSfilename; + TQString EPSfilename; KProcIO proc; proc << "kpsewhich" << filename; proc.start(KProcess::Block); diff --git a/kdvi/psgs.h b/kdvi/psgs.h index 0b6e679d..c1062f13 100644 --- a/kdvi/psgs.h +++ b/kdvi/psgs.h @@ -10,28 +10,28 @@ #ifndef _PSGS_H_ #define _PSGS_H_ -#include -#include -#include -#include +#include +#include +#include +#include class PageNumber; -class QPainter; +class TQPainter; class pageInfo { public: - pageInfo(const QString& _PostScriptString); + pageInfo(const TQString& _PostScriptString); ~pageInfo(); - QColor background; - QColor permanentBackground; - QString *PostScriptString; + TQColor background; + TQColor permanentBackground; + TQString *PostScriptString; }; -class ghostscript_interface : public QObject +class ghostscript_interface : public TQObject { Q_OBJECT @@ -42,16 +42,16 @@ public: void clear(); // sets the PostScript which is used on a certain page - void setPostScript(const PageNumber& page, const QString& PostScript); + void setPostScript(const PageNumber& page, const TQString& PostScript); // sets path from additional postscript files may be read - void setIncludePath(const QString &_includePath); + void setIncludePath(const TQString &_includePath); // Sets the background color for a certain page. If permanent is false then the original // background color can be restored by calling restoreBackground(page). // The Option permanent = false is used when we want to display a different paper // color as the one specified in the dvi file. - void setBackgroundColor(const PageNumber& page, const QColor& background_color, bool permanent = true); + void setBackgroundColor(const PageNumber& page, const TQColor& background_color, bool permanent = true); // Restore the background to the color which was specified by the last call to setBackgroundColor() // With option permanent = true. @@ -59,13 +59,13 @@ public: // Draws the graphics of the page into the painter, if possible. If // the page does not contain any graphics, nothing happens - void graphics(const PageNumber& page, double dpi, long magnification, QPainter* paint); + void graphics(const PageNumber& page, double dpi, long magnification, TQPainter* paint); // Returns the background color for a certain page. If no color was // set, Qt::white is returned. - QColor getBackgroundColor(const PageNumber& page) const; + TQColor getBackgroundColor(const PageNumber& page) const; - QString *PostScriptHeaderString; + TQString *PostScriptHeaderString; /** This method tries to find the PostScript file 'filename' in the DVI file's directory (if the base-URL indicates that the DVI file @@ -74,17 +74,17 @@ public: returned. Otherwise, the method returns the first argument. TODO: use the DVI file's baseURL, once this is implemented. */ - static QString locateEPSfile(const QString &filename, const KURL &base); + static TQString locateEPSfile(const TQString &filename, const KURL &base); private: - void gs_generate_graphics_file(const PageNumber& page, const QString& filename, long magnification); - QIntDict pageList; + void gs_generate_graphics_file(const PageNumber& page, const TQString& filename, long magnification); + TQIntDict pageList; double resolution; // in dots per inch int pixel_page_w; // in pixels int pixel_page_h; // in pixels - QString includePath; + TQString includePath; // Output device that ghostscript is supposed tp use. Default is // "png256". If that does not work, gs_generate_graphics_file will @@ -92,16 +92,16 @@ private: // device can be found, something is badly wrong. In that case, // "gsDevice" is set to an empty string, and // gs_generate_graphics_file will return immediately. - QValueListIterator gsDevice; + TQValueListIterator gsDevice; // A list of known devices, set by the constructor. This includes // "png256", "pnm". If a device is found to not work, its name is // removed from the list, and another device name is tried. - QStringList knownDevices; + TQStringList knownDevices; signals: /** Passed through to the top-level kpart. */ - void setStatusBarText( const QString& ); + void setStatusBarText( const TQString& ); }; #endif diff --git a/kdvi/renderedDviPagePixmap.h b/kdvi/renderedDviPagePixmap.h index 3b0f7272..c618806b 100644 --- a/kdvi/renderedDviPagePixmap.h +++ b/kdvi/renderedDviPagePixmap.h @@ -24,7 +24,7 @@ #include "renderedDocumentPagePixmap.h" -#include +#include class RenderedDviPagePixmap : public RenderedDocumentPagePixmap @@ -43,7 +43,7 @@ class RenderedDviPagePixmap : public RenderedDocumentPagePixmap List of source-hyperlinks in the current page. This vector is generated when the current page is drawn. */ - QValueVector sourceHyperLinkList; + TQValueVector sourceHyperLinkList; }; #endif diff --git a/kdvi/special.cpp b/kdvi/special.cpp index 23e58441..9f7eeb3d 100644 --- a/kdvi/special.cpp +++ b/kdvi/special.cpp @@ -12,11 +12,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "dviFile.h" #include "dviRenderer.h" @@ -28,9 +28,9 @@ //#define DEBUG_SPECIAL -extern QPainter *foreGroundPainter; +extern TQPainter *foreGroundPainter; -void dviRenderer::printErrorMsgForSpecials(const QString& msg) +void dviRenderer::printErrorMsgForSpecials(const TQString& msg) { if (dviFile->errorCounter < 25) { kdError(4300) << msg << endl; @@ -44,98 +44,98 @@ void dviRenderer::printErrorMsgForSpecials(const QString& msg) // dvips. If the spec could not be parsed, an invalid color will be // returned. -QColor dviRenderer::parseColorSpecification(const QString& colorSpec) +TQColor dviRenderer::parseColorSpecification(const TQString& colorSpec) { // Initialize the map of known colors, if that is not done yet. if (namedColors.isEmpty()) { - namedColors["Red"] = QColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*0)); - namedColors["Tan"] = QColor( (int)(255.0*0.86), (int)(255.0*0.58), (int)(255.0*0.44)); - namedColors["Blue"] = QColor( (int)(255.0*0), (int)(255.0*0), (int)(255.0*1)); - namedColors["Cyan"] = QColor( (int)(255.0*0), (int)(255.0*1), (int)(255.0*1)); - namedColors["Gray"] = QColor( (int)(255.0*0.5), (int)(255.0*0.5), (int)(255.0*0.5)); - namedColors["Plum"] = QColor( (int)(255.0*0.5), (int)(255.0*0), (int)(255.0*1)); - namedColors["Black"] = QColor( (int)(255.0*0), (int)(255.0*0), (int)(255.0*0)); - namedColors["Brown"] = QColor( (int)(255.0*0.4), (int)(255.0*0), (int)(255.0*0)); - namedColors["Green"] = QColor( (int)(255.0*0), (int)(255.0*1), (int)(255.0*0)); - namedColors["Melon"] = QColor( (int)(255.0*1), (int)(255.0*0.54), (int)(255.0*0.5)); - namedColors["Peach"] = QColor( (int)(255.0*1), (int)(255.0*0.5), (int)(255.0*0.3)); - namedColors["Sepia"] = QColor( (int)(255.0*0.3), (int)(255.0*0), (int)(255.0*0)); - namedColors["White"] = QColor( (int)(255.0*1), (int)(255.0*1), (int)(255.0*1)); - namedColors["Maroon"] = QColor( (int)(255.0*0.68), (int)(255.0*0), (int)(255.0*0)); - namedColors["Orange"] = QColor( (int)(255.0*1), (int)(255.0*0.39), (int)(255.0*0.13)); - namedColors["Orchid"] = QColor( (int)(255.0*0.68), (int)(255.0*0.36), (int)(255.0*1)); - namedColors["Purple"] = QColor( (int)(255.0*0.55), (int)(255.0*0.14), (int)(255.0*1)); - namedColors["Salmon"] = QColor( (int)(255.0*1), (int)(255.0*0.47), (int)(255.0*0.62)); - namedColors["Violet"] = QColor( (int)(255.0*0.21), (int)(255.0*0.12), (int)(255.0*1)); - namedColors["Yellow"] = QColor( (int)(255.0*1), (int)(255.0*1), (int)(255.0*0)); - namedColors["Apricot"] = QColor( (int)(255.0*1), (int)(255.0*0.68), (int)(255.0*0.48)); - namedColors["Emerald"] = QColor( (int)(255.0*0), (int)(255.0*1), (int)(255.0*0.5)); - namedColors["Fuchsia"] = QColor( (int)(255.0*0.45), (int)(255.0*0.01), (int)(255.0*0.92)); - namedColors["Magenta"] = QColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*1)); - namedColors["SkyBlue"] = QColor( (int)(255.0*0.38), (int)(255.0*1), (int)(255.0*0.88)); - namedColors["Thistle"] = QColor( (int)(255.0*0.88), (int)(255.0*0.41), (int)(255.0*1)); - namedColors["BrickRed"] = QColor( (int)(255.0*0.72), (int)(255.0*0), (int)(255.0*0)); - namedColors["Cerulean"] = QColor( (int)(255.0*0.06), (int)(255.0*0.89), (int)(255.0*1)); - namedColors["Lavender"] = QColor( (int)(255.0*1), (int)(255.0*0.52), (int)(255.0*1)); - namedColors["Mahogany"] = QColor( (int)(255.0*0.65), (int)(255.0*0), (int)(255.0*0)); - namedColors["Mulberry"] = QColor( (int)(255.0*0.64), (int)(255.0*0.08), (int)(255.0*0.98)); - namedColors["NavyBlue"] = QColor( (int)(255.0*0.06), (int)(255.0*0.46), (int)(255.0*1)); - namedColors["SeaGreen"] = QColor( (int)(255.0*0.31), (int)(255.0*1), (int)(255.0*0.5)); - namedColors["TealBlue"] = QColor( (int)(255.0*0.12), (int)(255.0*0.98), (int)(255.0*0.64)); - namedColors["BlueGreen"] = QColor( (int)(255.0*0.15), (int)(255.0*1), (int)(255.0*0.67)); - namedColors["CadetBlue"] = QColor( (int)(255.0*0.38), (int)(255.0*0.43), (int)(255.0*0.77)); - namedColors["Dandelion"] = QColor( (int)(255.0*1), (int)(255.0*0.71), (int)(255.0*0.16)); - namedColors["Goldenrod"] = QColor( (int)(255.0*1), (int)(255.0*0.9), (int)(255.0*0.16)); - namedColors["LimeGreen"] = QColor( (int)(255.0*0.5), (int)(255.0*1), (int)(255.0*0)); - namedColors["OrangeRed"] = QColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*0.5)); - namedColors["PineGreen"] = QColor( (int)(255.0*0), (int)(255.0*0.75), (int)(255.0*0.16)); - namedColors["RawSienna"] = QColor( (int)(255.0*0.55), (int)(255.0*0), (int)(255.0*0)); - namedColors["RedOrange"] = QColor( (int)(255.0*1), (int)(255.0*0.23), (int)(255.0*0.13)); - namedColors["RedViolet"] = QColor( (int)(255.0*0.59), (int)(255.0*0), (int)(255.0*0.66)); - namedColors["Rhodamine"] = QColor( (int)(255.0*1), (int)(255.0*0.18), (int)(255.0*1)); - namedColors["RoyalBlue"] = QColor( (int)(255.0*0), (int)(255.0*0.5), (int)(255.0*1)); - namedColors["RubineRed"] = QColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*0.87)); - namedColors["Turquoise"] = QColor( (int)(255.0*0.15), (int)(255.0*1), (int)(255.0*0.8)); - namedColors["VioletRed"] = QColor( (int)(255.0*1), (int)(255.0*0.19), (int)(255.0*1)); - namedColors["Aquamarine"] = QColor( (int)(255.0*0.18), (int)(255.0*1), (int)(255.0*0.7)); - namedColors["BlueViolet"] = QColor( (int)(255.0*0.1), (int)(255.0*0.05), (int)(255.0*0.96)); - namedColors["DarkOrchid"] = QColor( (int)(255.0*0.6), (int)(255.0*0.2), (int)(255.0*0.8)); - namedColors["OliveGreen"] = QColor( (int)(255.0*0), (int)(255.0*0.6), (int)(255.0*0)); - namedColors["Periwinkle"] = QColor( (int)(255.0*0.43), (int)(255.0*0.45), (int)(255.0*1)); - namedColors["Bittersweet"] = QColor( (int)(255.0*0.76), (int)(255.0*0.01), (int)(255.0*0)); - namedColors["BurntOrange"] = QColor( (int)(255.0*1), (int)(255.0*0.49), (int)(255.0*0)); - namedColors["ForestGreen"] = QColor( (int)(255.0*0), (int)(255.0*0.88), (int)(255.0*0)); - namedColors["GreenYellow"] = QColor( (int)(255.0*0.85), (int)(255.0*1), (int)(255.0*0.31)); - namedColors["JungleGreen"] = QColor( (int)(255.0*0.01), (int)(255.0*1), (int)(255.0*0.48)); - namedColors["ProcessBlue"] = QColor( (int)(255.0*0.04), (int)(255.0*1), (int)(255.0*1)); - namedColors["RoyalPurple"] = QColor( (int)(255.0*0.25), (int)(255.0*0.1), (int)(255.0*1)); - namedColors["SpringGreen"] = QColor( (int)(255.0*0.74), (int)(255.0*1), (int)(255.0*0.24)); - namedColors["YellowGreen"] = QColor( (int)(255.0*0.56), (int)(255.0*1), (int)(255.0*0.26)); - namedColors["MidnightBlue"] = QColor( (int)(255.0*0), (int)(255.0*0.44), (int)(255.0*0.57)); - namedColors["YellowOrange"] = QColor( (int)(255.0*1), (int)(255.0*0.58), (int)(255.0*0)); - namedColors["CarnationPink"] = QColor( (int)(255.0*1), (int)(255.0*0.37), (int)(255.0*1)); - namedColors["CornflowerBlue"] = QColor( (int)(255.0*0.35), (int)(255.0*0.87), (int)(255.0*1)); - namedColors["WildStrawberry"] = QColor( (int)(255.0*1), (int)(255.0*0.04), (int)(255.0*0.61)); + namedColors["Red"] = TQColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*0)); + namedColors["Tan"] = TQColor( (int)(255.0*0.86), (int)(255.0*0.58), (int)(255.0*0.44)); + namedColors["Blue"] = TQColor( (int)(255.0*0), (int)(255.0*0), (int)(255.0*1)); + namedColors["Cyan"] = TQColor( (int)(255.0*0), (int)(255.0*1), (int)(255.0*1)); + namedColors["Gray"] = TQColor( (int)(255.0*0.5), (int)(255.0*0.5), (int)(255.0*0.5)); + namedColors["Plum"] = TQColor( (int)(255.0*0.5), (int)(255.0*0), (int)(255.0*1)); + namedColors["Black"] = TQColor( (int)(255.0*0), (int)(255.0*0), (int)(255.0*0)); + namedColors["Brown"] = TQColor( (int)(255.0*0.4), (int)(255.0*0), (int)(255.0*0)); + namedColors["Green"] = TQColor( (int)(255.0*0), (int)(255.0*1), (int)(255.0*0)); + namedColors["Melon"] = TQColor( (int)(255.0*1), (int)(255.0*0.54), (int)(255.0*0.5)); + namedColors["Peach"] = TQColor( (int)(255.0*1), (int)(255.0*0.5), (int)(255.0*0.3)); + namedColors["Sepia"] = TQColor( (int)(255.0*0.3), (int)(255.0*0), (int)(255.0*0)); + namedColors["White"] = TQColor( (int)(255.0*1), (int)(255.0*1), (int)(255.0*1)); + namedColors["Maroon"] = TQColor( (int)(255.0*0.68), (int)(255.0*0), (int)(255.0*0)); + namedColors["Orange"] = TQColor( (int)(255.0*1), (int)(255.0*0.39), (int)(255.0*0.13)); + namedColors["Orchid"] = TQColor( (int)(255.0*0.68), (int)(255.0*0.36), (int)(255.0*1)); + namedColors["Purple"] = TQColor( (int)(255.0*0.55), (int)(255.0*0.14), (int)(255.0*1)); + namedColors["Salmon"] = TQColor( (int)(255.0*1), (int)(255.0*0.47), (int)(255.0*0.62)); + namedColors["Violet"] = TQColor( (int)(255.0*0.21), (int)(255.0*0.12), (int)(255.0*1)); + namedColors["Yellow"] = TQColor( (int)(255.0*1), (int)(255.0*1), (int)(255.0*0)); + namedColors["Apricot"] = TQColor( (int)(255.0*1), (int)(255.0*0.68), (int)(255.0*0.48)); + namedColors["Emerald"] = TQColor( (int)(255.0*0), (int)(255.0*1), (int)(255.0*0.5)); + namedColors["Fuchsia"] = TQColor( (int)(255.0*0.45), (int)(255.0*0.01), (int)(255.0*0.92)); + namedColors["Magenta"] = TQColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*1)); + namedColors["SkyBlue"] = TQColor( (int)(255.0*0.38), (int)(255.0*1), (int)(255.0*0.88)); + namedColors["Thistle"] = TQColor( (int)(255.0*0.88), (int)(255.0*0.41), (int)(255.0*1)); + namedColors["BrickRed"] = TQColor( (int)(255.0*0.72), (int)(255.0*0), (int)(255.0*0)); + namedColors["Cerulean"] = TQColor( (int)(255.0*0.06), (int)(255.0*0.89), (int)(255.0*1)); + namedColors["Lavender"] = TQColor( (int)(255.0*1), (int)(255.0*0.52), (int)(255.0*1)); + namedColors["Mahogany"] = TQColor( (int)(255.0*0.65), (int)(255.0*0), (int)(255.0*0)); + namedColors["Mulberry"] = TQColor( (int)(255.0*0.64), (int)(255.0*0.08), (int)(255.0*0.98)); + namedColors["NavyBlue"] = TQColor( (int)(255.0*0.06), (int)(255.0*0.46), (int)(255.0*1)); + namedColors["SeaGreen"] = TQColor( (int)(255.0*0.31), (int)(255.0*1), (int)(255.0*0.5)); + namedColors["TealBlue"] = TQColor( (int)(255.0*0.12), (int)(255.0*0.98), (int)(255.0*0.64)); + namedColors["BlueGreen"] = TQColor( (int)(255.0*0.15), (int)(255.0*1), (int)(255.0*0.67)); + namedColors["CadetBlue"] = TQColor( (int)(255.0*0.38), (int)(255.0*0.43), (int)(255.0*0.77)); + namedColors["Dandelion"] = TQColor( (int)(255.0*1), (int)(255.0*0.71), (int)(255.0*0.16)); + namedColors["Goldenrod"] = TQColor( (int)(255.0*1), (int)(255.0*0.9), (int)(255.0*0.16)); + namedColors["LimeGreen"] = TQColor( (int)(255.0*0.5), (int)(255.0*1), (int)(255.0*0)); + namedColors["OrangeRed"] = TQColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*0.5)); + namedColors["PineGreen"] = TQColor( (int)(255.0*0), (int)(255.0*0.75), (int)(255.0*0.16)); + namedColors["RawSienna"] = TQColor( (int)(255.0*0.55), (int)(255.0*0), (int)(255.0*0)); + namedColors["RedOrange"] = TQColor( (int)(255.0*1), (int)(255.0*0.23), (int)(255.0*0.13)); + namedColors["RedViolet"] = TQColor( (int)(255.0*0.59), (int)(255.0*0), (int)(255.0*0.66)); + namedColors["Rhodamine"] = TQColor( (int)(255.0*1), (int)(255.0*0.18), (int)(255.0*1)); + namedColors["RoyalBlue"] = TQColor( (int)(255.0*0), (int)(255.0*0.5), (int)(255.0*1)); + namedColors["RubineRed"] = TQColor( (int)(255.0*1), (int)(255.0*0), (int)(255.0*0.87)); + namedColors["Turquoise"] = TQColor( (int)(255.0*0.15), (int)(255.0*1), (int)(255.0*0.8)); + namedColors["VioletRed"] = TQColor( (int)(255.0*1), (int)(255.0*0.19), (int)(255.0*1)); + namedColors["Aquamarine"] = TQColor( (int)(255.0*0.18), (int)(255.0*1), (int)(255.0*0.7)); + namedColors["BlueViolet"] = TQColor( (int)(255.0*0.1), (int)(255.0*0.05), (int)(255.0*0.96)); + namedColors["DarkOrchid"] = TQColor( (int)(255.0*0.6), (int)(255.0*0.2), (int)(255.0*0.8)); + namedColors["OliveGreen"] = TQColor( (int)(255.0*0), (int)(255.0*0.6), (int)(255.0*0)); + namedColors["Periwinkle"] = TQColor( (int)(255.0*0.43), (int)(255.0*0.45), (int)(255.0*1)); + namedColors["Bittersweet"] = TQColor( (int)(255.0*0.76), (int)(255.0*0.01), (int)(255.0*0)); + namedColors["BurntOrange"] = TQColor( (int)(255.0*1), (int)(255.0*0.49), (int)(255.0*0)); + namedColors["ForestGreen"] = TQColor( (int)(255.0*0), (int)(255.0*0.88), (int)(255.0*0)); + namedColors["GreenYellow"] = TQColor( (int)(255.0*0.85), (int)(255.0*1), (int)(255.0*0.31)); + namedColors["JungleGreen"] = TQColor( (int)(255.0*0.01), (int)(255.0*1), (int)(255.0*0.48)); + namedColors["ProcessBlue"] = TQColor( (int)(255.0*0.04), (int)(255.0*1), (int)(255.0*1)); + namedColors["RoyalPurple"] = TQColor( (int)(255.0*0.25), (int)(255.0*0.1), (int)(255.0*1)); + namedColors["SpringGreen"] = TQColor( (int)(255.0*0.74), (int)(255.0*1), (int)(255.0*0.24)); + namedColors["YellowGreen"] = TQColor( (int)(255.0*0.56), (int)(255.0*1), (int)(255.0*0.26)); + namedColors["MidnightBlue"] = TQColor( (int)(255.0*0), (int)(255.0*0.44), (int)(255.0*0.57)); + namedColors["YellowOrange"] = TQColor( (int)(255.0*1), (int)(255.0*0.58), (int)(255.0*0)); + namedColors["CarnationPink"] = TQColor( (int)(255.0*1), (int)(255.0*0.37), (int)(255.0*1)); + namedColors["CornflowerBlue"] = TQColor( (int)(255.0*0.35), (int)(255.0*0.87), (int)(255.0*1)); + namedColors["WildStrawberry"] = TQColor( (int)(255.0*1), (int)(255.0*0.04), (int)(255.0*0.61)); } - QString specType = colorSpec.section(' ', 0, 0); + TQString specType = colorSpec.section(' ', 0, 0); if (specType.find("rgb", false) == 0) { bool ok; double r = colorSpec.section(' ', 1, 1).toDouble(&ok); if ((ok == false) || (r < 0.0) || (r > 1.0)) - return QColor(); + return TQColor(); double g = colorSpec.section(' ', 2, 2).toDouble(&ok); if ((ok == false) || (g < 0.0) || (g > 1.0)) - return QColor(); + return TQColor(); double b = colorSpec.section(' ', 3, 3).toDouble(&ok); if ((ok == false) || (b < 0.0) || (b > 1.0)) - return QColor(); + return TQColor(); - return QColor((int)(r*255.0+0.5), (int)(g*255.0+0.5), (int)(b*255.0+0.5)); + return TQColor((int)(r*255.0+0.5), (int)(g*255.0+0.5), (int)(b*255.0+0.5)); } if (specType.find("hsb", false) == 0) { @@ -143,17 +143,17 @@ QColor dviRenderer::parseColorSpecification(const QString& colorSpec) double h = colorSpec.section(' ', 1, 1).toDouble(&ok); if ((ok == false) || (h < 0.0) || (h > 1.0)) - return QColor(); + return TQColor(); double s = colorSpec.section(' ', 2, 2).toDouble(&ok); if ((ok == false) || (s < 0.0) || (s > 1.0)) - return QColor(); + return TQColor(); double b = colorSpec.section(' ', 3, 3).toDouble(&ok); if ((ok == false) || (b < 0.0) || (b > 1.0)) - return QColor(); + return TQColor(); - return QColor((int)(h*359.0+0.5), (int)(s*255.0+0.5), (int)(b*255.0+0.5), QColor::Hsv); + return TQColor((int)(h*359.0+0.5), (int)(s*255.0+0.5), (int)(b*255.0+0.5), TQColor::Hsv); } if (specType.find("cmyk", false) == 0) { @@ -161,19 +161,19 @@ QColor dviRenderer::parseColorSpecification(const QString& colorSpec) double c = colorSpec.section(' ', 1, 1).toDouble(&ok); if ((ok == false) || (c < 0.0) || (c > 1.0)) - return QColor(); + return TQColor(); double m = colorSpec.section(' ', 2, 2).toDouble(&ok); if ((ok == false) || (m < 0.0) || (m > 1.0)) - return QColor(); + return TQColor(); double y = colorSpec.section(' ', 3, 3).toDouble(&ok); if ((ok == false) || (y < 0.0) || (y > 1.0)) - return QColor(); + return TQColor(); double k = colorSpec.section(' ', 3, 3).toDouble(&ok); if ((ok == false) || (k < 0.0) || (k > 1.0)) - return QColor(); + return TQColor(); // Convert cmyk coordinates to rgb. double r = 1.0 - c - k; @@ -186,7 +186,7 @@ QColor dviRenderer::parseColorSpecification(const QString& colorSpec) if (b < 0.0) b = 0.0; - return QColor((int)(r*255.0+0.5), (int)(g*255.0+0.5), (int)(b*255.0+0.5)); + return TQColor((int)(r*255.0+0.5), (int)(g*255.0+0.5), (int)(b*255.0+0.5)); } if (specType.find("gray", false) == 0) { @@ -194,17 +194,17 @@ QColor dviRenderer::parseColorSpecification(const QString& colorSpec) double g = colorSpec.section(' ', 1, 1).toDouble(&ok); if ((ok == false) || (g < 0.0) || (g > 1.0)) - return QColor(); + return TQColor(); - return QColor((int)(g*255.0+0.5), (int)(g*255.0+0.5), (int)(g*255.0+0.5)); + return TQColor((int)(g*255.0+0.5), (int)(g*255.0+0.5), (int)(g*255.0+0.5)); } // Check if the color is one of the known named colors. - QMap::Iterator f = namedColors.find(specType); + TQMap::Iterator f = namedColors.find(specType); if (f != namedColors.end()) return *f; - return QColor(specType); + return TQColor(specType); } @@ -212,11 +212,11 @@ QColor dviRenderer::parseColorSpecification(const QString& colorSpec) -void dviRenderer::color_special(const QString& _cp) +void dviRenderer::color_special(const TQString& _cp) { - QString const cp = _cp.stripWhiteSpace(); + TQString const cp = _cp.stripWhiteSpace(); - QString command = cp.section(' ', 0, 0); + TQString command = cp.section(' ', 0, 0); if (command == "pop") { // Take color off the stack @@ -230,7 +230,7 @@ void dviRenderer::color_special(const QString& _cp) if (command == "push") { // Get color specification - QColor const col = parseColorSpecification(cp.section(' ', 1)); + TQColor const col = parseColorSpecification(cp.section(' ', 1)); // Set color if (col.isValid()) colorStack.push(col); @@ -241,7 +241,7 @@ void dviRenderer::color_special(const QString& _cp) // Get color specification and set the color for the rest of this // page - QColor col = parseColorSpecification(cp); + TQColor col = parseColorSpecification(cp); // Set color if (col.isValid()) globalColor = col; @@ -251,15 +251,15 @@ void dviRenderer::color_special(const QString& _cp) } -void dviRenderer::html_href_special(const QString& _cp) +void dviRenderer::html_href_special(const TQString& _cp) { - QString cp = _cp; + TQString cp = _cp; cp.truncate(cp.find('"')); #ifdef DEBUG_SPECIAL kdDebug(4300) << "HTML-special, href " << cp.latin1() << endl; #endif - HTML_href = new QString(cp); + HTML_href = new TQString(cp); } @@ -276,7 +276,7 @@ void dviRenderer::html_anchor_end() } -void dviRenderer::source_special(const QString& cp) +void dviRenderer::source_special(const TQString& cp) { // only when rendering really takes place: set source_href to the // current special string. When characters are rendered, the @@ -286,15 +286,15 @@ void dviRenderer::source_special(const QString& cp) if (source_href) *source_href = cp; else - source_href = new QString(cp); + source_href = new TQString(cp); } -void parse_special_argument(const QString& strg, const char* argument_name, int* variable) +void parse_special_argument(const TQString& strg, const char* argument_name, int* variable) { int index = strg.find(argument_name); if (index >= 0) { - QString tmp = strg.mid(index + strlen(argument_name)); + TQString tmp = strg.mid(index + strlen(argument_name)); index = tmp.find(' '); if (index >= 0) tmp.truncate(index); @@ -313,20 +313,20 @@ void parse_special_argument(const QString& strg, const char* argument_name, int* } -void dviRenderer::epsf_special(const QString& cp) +void dviRenderer::epsf_special(const TQString& cp) { #ifdef DEBUG_SPECIAL kdDebug(4300) << "epsf-special: psfile=" << cp <name(); + TQString const & mime_type_name = mime_type->name(); bool const isGFX = (mime_type_name == "image/png" || mime_type_name == "image/gif" || mime_type_name == "image/jpeg" || @@ -368,7 +368,7 @@ void dviRenderer::epsf_special(const QString& cp) // So, if we do not have a PostScript file, but a graphics file, and // if that file exists, we draw it here. - if (isGFX && QFile::exists(EPSfilename)) { + if (isGFX && TQFile::exists(EPSfilename)) { // Don't show PostScript, just draw the bounding box. For this, // calculate the size of the bounding box in Pixels. double bbox_width = urx - llx; @@ -388,13 +388,13 @@ void dviRenderer::epsf_special(const QString& cp) bbox_width *= 0.1 * 65536.0*fontPixelPerDVIunit / shrinkfactor; bbox_height *= 0.1 * 65536.0*fontPixelPerDVIunit / shrinkfactor; - QImage image(EPSfilename); + TQImage image(EPSfilename); image = image.smoothScale((int)(bbox_width), (int)(bbox_height)); foreGroundPainter->drawImage( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), currinf.data.pxl_v - (int)bbox_height, image); return; } - if (!_postscript || !QFile::exists(EPSfilename)) { + if (!_postscript || !TQFile::exists(EPSfilename)) { // Don't show PostScript, just draw the bounding box. For this, // calculate the size of the bounding box in Pixels. double bbox_width = urx - llx; @@ -414,21 +414,21 @@ void dviRenderer::epsf_special(const QString& cp) bbox_width *= 0.1 * 65536.0*fontPixelPerDVIunit / shrinkfactor; bbox_height *= 0.1 * 65536.0*fontPixelPerDVIunit / shrinkfactor; - QRect bbox(((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), currinf.data.pxl_v - (int)bbox_height, + TQRect bbox(((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), currinf.data.pxl_v - (int)bbox_height, (int)bbox_width, (int)bbox_height); foreGroundPainter->save(); - if (QFile::exists(EPSfilename)) + if (TQFile::exists(EPSfilename)) foreGroundPainter->setBrush(Qt::lightGray); else foreGroundPainter->setBrush(Qt::red); foreGroundPainter->setPen(Qt::black); foreGroundPainter->drawRoundRect(bbox, 2, 2); - QFont f = foreGroundPainter->font(); + TQFont f = foreGroundPainter->font(); f.setPointSize(8); foreGroundPainter->setFont(f); - if (QFile::exists(EPSfilename)) + if (TQFile::exists(EPSfilename)) foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), EPSfilename_orig, -1); else foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), @@ -451,30 +451,30 @@ void dviRenderer::TPIC_flushPath_special() return; } - QPen pen(Qt::black, (int)(penWidth_in_mInch*resolutionInDPI/1000.0 + 0.5)); // Sets the pen size in milli-inches + TQPen pen(Qt::black, (int)(penWidth_in_mInch*resolutionInDPI/1000.0 + 0.5)); // Sets the pen size in milli-inches foreGroundPainter->setPen(pen); foreGroundPainter->drawPolyline(TPIC_path, 0, number_of_elements_in_path); number_of_elements_in_path = 0; } -void dviRenderer::TPIC_addPath_special(const QString& cp) +void dviRenderer::TPIC_addPath_special(const TQString& cp) { #ifdef DEBUG_SPECIAL kdDebug(4300) << "TPIC special addPath: " << cp << endl; #endif // Adds a point to the path list - QString cp_noWhiteSpace = cp.stripWhiteSpace(); + TQString cp_noWhiteSpace = cp.stripWhiteSpace(); bool ok; float xKoord = cp_noWhiteSpace.section(' ', 0, 0).toFloat(&ok); if (ok == false) { - printErrorMsgForSpecials( QString("TPIC special; cannot parse first argument in 'pn %1'.").arg(cp) ); + printErrorMsgForSpecials( TQString("TPIC special; cannot parse first argument in 'pn %1'.").arg(cp) ); return; } float yKoord = cp_noWhiteSpace.section(' ', 1, 1).toFloat(&ok); if (ok == false) { - printErrorMsgForSpecials( QString("TPIC special; cannot parse second argument in 'pn %1'.").arg(cp) ); + printErrorMsgForSpecials( TQString("TPIC special; cannot parse second argument in 'pn %1'.").arg(cp) ); return; } @@ -492,7 +492,7 @@ void dviRenderer::TPIC_addPath_special(const QString& cp) } -void dviRenderer::TPIC_setPen_special(const QString& cp) +void dviRenderer::TPIC_setPen_special(const TQString& cp) { #ifdef DEBUG_SPECIAL kdDebug(4300) << "TPIC special setPen: " << cp << endl; @@ -502,7 +502,7 @@ void dviRenderer::TPIC_setPen_special(const QString& cp) bool ok; penWidth_in_mInch = cp.stripWhiteSpace().toFloat(&ok); if (ok == false) { - printErrorMsgForSpecials( QString("TPIC special; cannot parse argument in 'pn %1'.").arg(cp) ); + printErrorMsgForSpecials( TQString("TPIC special; cannot parse argument in 'pn %1'.").arg(cp) ); penWidth_in_mInch = 0.0; return; } @@ -511,7 +511,7 @@ void dviRenderer::TPIC_setPen_special(const QString& cp) void dviRenderer::applicationDoSpecial(char *cp) { - QString special_command(cp); + TQString special_command(cp); // First come specials which is only interpreted during rendering, // and NOT during the prescan phase @@ -572,7 +572,7 @@ void dviRenderer::applicationDoSpecial(char *cp) // Hyperref: start of hyperref rectangle. At this stage it is not // yet clear if the rectangle will conain a hyperlink, an anchor, // or another type of object. We suspect that this rectangle will - // define a hyperlink, allocate a QString and set HTML_href to + // define a hyperlink, allocate a TQString and set HTML_href to // point to this string. The string contains the name of the // destination which ---due to the nature of the PostScript // language--- will be defined only after characters are drawn and @@ -595,7 +595,7 @@ void dviRenderer::applicationDoSpecial(char *cp) else break; - HTML_href = new QString("glopglyph"); + HTML_href = new TQString("glopglyph"); return; } @@ -656,8 +656,8 @@ void dviRenderer::applicationDoSpecial(char *cp) // - Sec. 3.2.2. The specification is implemented completely: // balanced parentheses and all escape sequences are // considered. - QString tmpTargetName = special_command.section('(', 1); - QString targetName; + TQString tmpTargetName = special_command.section('(', 1); + TQString targetName; int parencount = 1; for(int i=0; i::iterator it; + TQValueVector::iterator it; for( it = currentlyDrawnPage->hyperLinkList.begin(); it != currentlyDrawnPage->hyperLinkList.end(); ++it ) if (it->linkText == "glopglyph") it->linkText = targetName; diff --git a/kdvi/util.cpp b/kdvi/util.cpp index d25b7e03..5b242cf1 100644 --- a/kdvi/util.cpp +++ b/kdvi/util.cpp @@ -68,7 +68,7 @@ * Print error message and quit. */ -void oops(QString message) +void oops(TQString message) { kdError() << i18n("Fatal Error! ") << message << endl; diff --git a/kdvi/vf.cpp b/kdvi/vf.cpp index 36cad0ba..679aa9e0 100644 --- a/kdvi/vf.cpp +++ b/kdvi/vf.cpp @@ -36,7 +36,7 @@ #include "fontpool.h" #include "xdvi.h" -extern void oops(QString message); +extern void oops(TQString message); /*** *** VF font reading routines. -- cgit v1.2.3
%1 %2
%1 %2
%1 %2
%1 %2
%1
%1
%1 %2
%1 %2
%1 %2
%1 %2