diff options
Diffstat (limited to 'src/kernel/qpsprinter.cpp')
-rw-r--r-- | src/kernel/qpsprinter.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/src/kernel/qpsprinter.cpp b/src/kernel/qpsprinter.cpp index 7d660b471..c2b9aad7e 100644 --- a/src/kernel/qpsprinter.cpp +++ b/src/kernel/qpsprinter.cpp @@ -100,13 +100,13 @@ #include "qfontengine_p.h" #include "qtextlayout_p.h" #include "qtextengine_p.h" -extern bool qt_has_xft; +extern bool tqt_has_xft; #endif static bool qt_gen_epsf = FALSE; static bool embedFonts = TRUE; -Q_EXPORT void qt_generate_epsf( bool b ) +Q_EXPORT void tqt_generate_epsf( bool b ) { qt_gen_epsf = b; } @@ -1668,7 +1668,7 @@ unsigned short TQPSPrinterFontPrivate::insertIntoSubset( unsigned short u ) pageSubsetCount++; } } else { - qWarning("TQPSPrinterFont::internal error"); + tqWarning("TQPSPrinterFont::internal error"); } return retval; } @@ -1677,7 +1677,7 @@ void TQPSPrinterFontPrivate::restore() { page_subset.clear(); pageSubsetCount = 0; - //qDebug("restore for font %s\n",psname.latin1()); + //tqDebug("restore for font %s\n",psname.latin1()); } static inline const char *toHex( uchar u ) @@ -1814,7 +1814,7 @@ unsigned short TQPSPrinterFontPrivate::mapUnicode( unsigned short unicode ) if ( !found ) { return insertIntoSubset( unicode ); } - //qDebug("mapping unicode %x to %x", unicode, offset+*res); + //tqDebug("mapping unicode %x to %x", unicode, offset+*res); return offset + *res; } @@ -2289,7 +2289,7 @@ TQPSPrinterFontTTF::TQPSPrinterFontTTF(const TQFontEngine *f, TQByteArray& d) else if (TQString(environment_preference) == "3") target_type = 3; else - qWarning("The value of QT_TTFTOPS must be 42 or 3"); + tqWarning("The value of QT_TTFTOPS must be 42 or 3"); } #endif offset_table = (unsigned char*) data.data(); /* first 12 bytes */ @@ -2318,12 +2318,12 @@ TQPSPrinterFontTTF::TQPSPrinterFontTTF(const TQFontEngine *f, TQByteArray& d) ury = topost( getFWord( ptr + 42 ) ); indexToLocFormat = getSHORT( ptr + 50 ); /* size of 'loca' data */ if(indexToLocFormat != 0 && indexToLocFormat != 1) { - qWarning("TrueType font is unusable because indexToLocFormat != 0"); + tqWarning("TrueType font is unusable because indexToLocFormat != 0"); defective = TRUE; return; } if( getSHORT(ptr+52) != 0 ) { - qWarning("TrueType font is unusable because glyphDataFormat != 0"); + tqWarning("TrueType font is unusable because glyphDataFormat != 0"); defective = TRUE; return; } @@ -2340,7 +2340,7 @@ TQPSPrinterFontTTF::TQPSPrinterFontTTF(const TQFontEngine *f, TQByteArray& d) BYTE* table_ptr = getTable("name"); /* pointer to table */ if ( !table_ptr ) { defective = TRUE; - qDebug("couldn't find name table" ); + tqDebug("couldn't find name table" ); return; } int numrecords = getUSHORT( table_ptr + 2 ); /* number of names */ @@ -2392,8 +2392,8 @@ TQPSPrinterFontTTF::TQPSPrinterFontTTF(const TQFontEngine *f, TQByteArray& d) Fixed post_format = getFixed( post_table ); if( post_format.whole != 2 || post_format.fraction != 0 ) { - qWarning("TrueType font does not have a format 2.0 'post' table"); - qWarning("post format is %d.%d",post_format.whole,post_format.fraction); + tqWarning("TrueType font does not have a format 2.0 'post' table"); + tqWarning("post format is %d.%d",post_format.whole,post_format.fraction); // Sivan Feb 2001: no longer defective. // defective = TRUE; } @@ -2402,11 +2402,11 @@ TQPSPrinterFontTTF::TQPSPrinterFontTTF(const TQFontEngine *f, TQByteArray& d) BYTE *maxp = getTable("maxp"); if ( !maxp ) { defective = TRUE; - qDebug("no maxp table in font"); + tqDebug("no maxp table in font"); return; } numGlyphs = getUSHORT( maxp + 4 ); -// qDebug("number of glyphs is %d", numGlyphs); +// tqDebug("number of glyphs is %d", numGlyphs); replacementList = makePSFontNameList( f, psname ); uni2glyphSetup(); } @@ -2505,8 +2505,8 @@ void TQPSPrinterFontTTF::download(TQTextStream& s,bool global) return; } - //qDebug("downloading ttf font %s", psname.latin1() ); - //qDebug("target type=%d", target_type); + //tqDebug("downloading ttf font %s", psname.latin1() ); + //tqDebug("target type=%d", target_type); global_dict = global; TQMap<unsigned short, unsigned short> *subsetDict = ⊂ if ( !global ) @@ -2716,7 +2716,7 @@ void TQPSPrinterFontTTF::download(TQTextStream& s,bool global) } else { /* type 3 */ if (!glyphset[x]) continue; - //qDebug("emitting charproc for glyph %d, name=%s", x, glyphName(x).latin1() ); + //tqDebug("emitting charproc for glyph %d, name=%s", x, glyphName(x).latin1() ); s << "/"; s << glyphName( x, glyphset ); s << "{"; @@ -2916,7 +2916,7 @@ void TQPSPrinterFontTTF::uni2glyphSetup() } } if (map==nmaps) { - qWarning("Font does not have unicode encoding\n"); + tqWarning("Font does not have unicode encoding\n"); return; // no unicode encoding! } @@ -2928,7 +2928,7 @@ void TQPSPrinterFontTTF::uni2glyphSetup() //fprintf(stderr,"Unicode cmap format %d\n",format); if (format != 4) { - //qWarning("Unicode cmap format is not 4"); + //tqWarning("Unicode cmap format is not 4"); return; } @@ -3145,7 +3145,7 @@ void TQPSPrinterFontTTF::sfnts_glyf_table(ULONG oldoffset, ** two byte boundary. */ if( length % 2 ) { - qWarning("TrueType font contains a 'glyf' table without 2 byte padding"); + tqWarning("TrueType font contains a 'glyf' table without 2 byte padding"); defective = TRUE; return; } @@ -3168,7 +3168,7 @@ void TQPSPrinterFontTTF::sfnts_glyf_table(ULONG oldoffset, /* Look for unexplainable descrepancies between sizes */ if( total != correct_total_length ) { - qWarning("TQPSPrinterFontTTF::sfnts_glyf_table: total != correct_total_length"); + tqWarning("TQPSPrinterFontTTF::sfnts_glyf_table: total != correct_total_length"); defective = TRUE; return; } @@ -3260,7 +3260,7 @@ void TQPSPrinterFontTTF::download_sfnts(TQTextStream& s) sfnts_pputUSHORT(81,s, string_len, line_len, in_string); /* rangeShift */ } else { - qWarning("Fewer than 9 tables selected"); + tqWarning("Fewer than 9 tables selected"); } /* Now, emmit the table directory. */ @@ -3297,7 +3297,7 @@ void TQPSPrinterFontTTF::download_sfnts(TQTextStream& s) string_len, line_len, in_string); } else { // other tables should not exceed 64K (not always true; Sivan) if( tables[x].length > 65535 ) { - qWarning("TrueType font has a table which is too long"); + tqWarning("TrueType font has a table which is too long"); defective = TRUE; return; } @@ -3699,7 +3699,7 @@ void TQPSPrinterFontTTF::charprocLoad(BYTE *glyph, charproc_data* cd) ct = *(glyph++); if( (x + ct) > cd->num_pts ) { - qWarning("Fatal Error in TT flags"); + tqWarning("Fatal Error in TT flags"); return; } @@ -4053,7 +4053,7 @@ TQPSPrinterFontPFA::TQPSPrinterFontPFA(const TQFontEngine *f, TQByteArray& d) TQString fontname; if (p[ pos ] != '%' || p[ pos+1 ] != '!') { // PFA marker - qWarning("invalid pfa file"); + tqWarning("invalid pfa file"); return; } @@ -4079,7 +4079,7 @@ void TQPSPrinterFontPFA::download(TQTextStream& s, bool global) return; } - //qDebug("downloading pfa font %s", psname.latin1() ); + //tqDebug("downloading pfa font %s", psname.latin1() ); char* p = data.data(); s << "% Font resource\n"; @@ -4111,7 +4111,7 @@ TQPSPrinterFontPFB::TQPSPrinterFontPFB(const TQFontEngine *f, TQByteArray& d) TQString fontname; if (p[ pos ] != 0x80) { // PFB marker - qWarning("pfb file does not start with 0x80"); + tqWarning("pfb file does not start with 0x80"); return; } pos++; @@ -4146,7 +4146,7 @@ void TQPSPrinterFontPFB::download(TQTextStream& s, bool global) return; } - //qDebug("downloading pfb font %s", psname.latin1() ); + //tqDebug("downloading pfb font %s", psname.latin1() ); unsigned char* p = (unsigned char*) data.data(); int pos; int len; @@ -4173,7 +4173,7 @@ void TQPSPrinterFontPFB::download(TQTextStream& s, bool global) len |= (p[ pos ] << 16); pos++; len |= (p[ pos ] << 24); pos++; - //qDebug("font block type %d len %d",typ,len); + //tqDebug("font block type %d len %d",typ,len); int end = pos + len; if (typ==1) { @@ -4182,7 +4182,7 @@ void TQPSPrinterFontPFB::download(TQTextStream& s, bool global) s << "\n"; hexcol = 0; } - //qWarning(TQString::fromLatin1((char*)(p+pos),1)); + //tqWarning(TQString::fromLatin1((char*)(p+pos),1)); if (p[pos] == '\r' || p[pos] == '\n') { s << "\n"; while (pos < end && (p[pos] == '\r' || p[pos] == '\n')) @@ -4233,7 +4233,7 @@ TQPSPrinterFontNotFound::TQPSPrinterFontNotFound(const TQFontEngine* f) void TQPSPrinterFontNotFound::download(TQTextStream& s, bool) { - //qDebug("downloading not found font %s", psname.latin1() ); + //tqDebug("downloading not found font %s", psname.latin1() ); emitPSFontNameList( s, psname, replacementList ); s << "% No embeddable font for "; s << psname; @@ -4350,7 +4350,7 @@ TQString TQPSPrinterFontAsian::defineFont( TQTextStream &stream, const TQString void TQPSPrinterFontAsian::download(TQTextStream& s, bool) { - //qDebug("downloading asian font %s", psname.latin1() ); + //tqDebug("downloading asian font %s", psname.latin1() ); s << "% Asian postscript font requested. Using " << psname << endl; emitPSFontNameList( s, psname, replacementList ); @@ -4871,7 +4871,7 @@ TQPSPrinterFontSimplifiedChinese::TQPSPrinterFontSimplifiedChinese(const TQFontE psname = SongGBK2K[type].psname; appendReplacements( replacementList, SimplifiedReplacements, type ); } - //qDebug("simplified chinese: fontname is %s, psname=%s", f.family().latin1(), psname.latin1() ); + //tqDebug("simplified chinese: fontname is %s, psname=%s", f.family().latin1(), psname.latin1() ); } TQString TQPSPrinterFontSimplifiedChinese::extension() const @@ -4921,14 +4921,14 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate #if defined( Q_WS_X11 ) bool xlfd = FALSE; - //qDebug("engine = %p name=%s, script=%d", engine, engine ? engine->name() : "(null)", script); + //tqDebug("engine = %p name=%s, script=%d", engine, engine ? engine->name() : "(null)", script); #ifndef QT_NO_XFTFREETYPE - if ( qt_has_xft && engine && engine->type() == TQFontEngine::Xft ) { + if ( tqt_has_xft && engine && engine->type() == TQFontEngine::Xft ) { XftPattern *pattern = static_cast<TQFontEngineXft *>( engine )->pattern(); char *filename = 0; XftPatternGetString (pattern, XFT_FILE, 0, &filename); - //qDebug("filename for font is '%s'", filename); + //tqDebug("filename for font is '%s'", filename); if ( filename ) { fontfilename = TQString::fromLocal8Bit( filename ); xfontname = fontfilename; @@ -4996,7 +4996,7 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate xfontname += "/" + toString( script ); #endif - //qDebug("looking for font %s in dict", xfontname.latin1() ); + //tqDebug("looking for font %s in dict", xfontname.latin1() ); p = priv->fonts.find(xfontname); if ( p ) return; @@ -5014,15 +5014,15 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate fontmapname = (*it) + "/fonts.scale"; else fontmapname = (*it) + "/fonts.dir"; - //qWarning(fontmapname); + //tqWarning(fontmapname); TQFile fontmap(fontmapname); if (fontmap.open(IO_ReadOnly)) { while (!fontmap.atEnd()) { TQString mapping; fontmap.readLine(mapping,512); // fold to lower (since X folds to lowercase) - //qWarning(xfontname); - //qWarning(mapping); + //tqWarning(xfontname); + //tqWarning(mapping); if (mapping.lower().contains(searchname.lower())) { int index = mapping.find(' ',0); TQString ffn = mapping.mid(0,index); @@ -5031,7 +5031,7 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate !ffn.contains( ".spd" ) && !ffn.contains( ".phont" ) ) { fontfilename = (*it) + TQString("/") + ffn; if ( TQFile::exists(fontfilename) ) { - //qDebug("found font file %s", fontfilename.latin1()); + //tqDebug("found font file %s", fontfilename.latin1()); break; } else // unset fontfilename fontfilename = TQString(); @@ -5046,7 +5046,7 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate } #endif - //qDebug("font=%s, fontname=%s, file=%s, p=%p", f.family().latin1(), xfontname.latin1(), fontfilename.latin1(), p); + //tqDebug("font=%s, fontname=%s, file=%s, p=%p", f.family().latin1(), xfontname.latin1(), fontfilename.latin1(), p); // memory mapping would be better here if (fontfilename.length() > 0) { // maybe there is no file name @@ -5074,7 +5074,7 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate } else type = NONE; - //qDebug("font is of type %d", type ); + //tqDebug("font is of type %d", type ); switch (type) { case TTF : p = new TQPSPrinterFontTTF(engine, data); @@ -5116,7 +5116,7 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate } } else #endif - //qDebug("didnt find font for %s", xfontname.latin1()); + //tqDebug("didnt find font for %s", xfontname.latin1()); p = new TQPSPrinterFontNotFound( engine ); break; } @@ -5128,14 +5128,14 @@ TQPSPrinterFont::TQPSPrinterFont(const TQFont &f, int script, TQPSPrinterPrivate TQDictIterator<TQPSPrinterFontPrivate> it( priv->fonts ); for( it.toFirst(); it.current(); ++it ) { if ( *(*it) == *p ) { -// qWarning("Post script driver: font already in dict"); +// tqWarning("Post script driver: font already in dict"); delete p; p = *it; return; } } - //qDebug("inserting font %s in dict psname=%s", xfontname.latin1(), p->postScriptFontName().latin1() ); + //tqDebug("inserting font %s in dict psname=%s", xfontname.latin1(), p->postScriptFontName().latin1() ); priv->fonts.insert( xfontname, p ); } @@ -5165,7 +5165,7 @@ TQPSPrinterPrivate::TQPSPrinterPrivate( TQPrinter *prt, int filedes ) int npaths; char** font_path; - font_path = XGetFontPath( qt_xdisplay(), &npaths); + font_path = XGetFontPath( tqt_xdisplay(), &npaths); bool xfsconfig_read = FALSE; for (int i=0; i<npaths; i++) { // If we're using xfs, append font paths from /etc/X11/fs/config @@ -5235,7 +5235,7 @@ void TQPSPrinterPrivate::setFont( const TQFont & fnt, int script ) } if ( f.pointSize() == 0 ) { #if defined(CHECK_RANGE) - qWarning( "TQPrinter: Cannot set a font with zero point size." ); + tqWarning( "TQPrinter: Cannot set a font with zero point size." ); #endif f.setPointSize(TQApplication::font().pointSize()); if ( f.pointSize() == 0 ) @@ -5529,7 +5529,7 @@ static TQByteArray compress( const TQImage & image, bool gray ) { #if 0 /* this should never happen: both the start and the end pointers ran off their tracks. */ - qDebug( "oops! %06x %06x %06x %06x %5d %5d %5d %d", + tqDebug( "oops! %06x %06x %06x %06x %5d %5d %5d %d", pixel[start], pixel[end], pixel[index], pixel[index+bestLength], start, end, index, bestLength ); @@ -5716,20 +5716,20 @@ static TQByteArray compress( const TQImage & image, bool gray ) { delete [] pixel; #ifdef DEBUG_COMPRESS - qDebug( "------------- image compression statistics ----------------" ); - qDebug(" compression time %d", t.elapsed() ); - qDebug( "Size dist of uncompressed blocks:" ); - qDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[0], sizeUncompressed[1], + tqDebug( "------------- image compression statistics ----------------" ); + tqDebug(" compression time %d", t.elapsed() ); + tqDebug( "Size dist of uncompressed blocks:" ); + tqDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[0], sizeUncompressed[1], sizeUncompressed[2], sizeUncompressed[3], sizeUncompressed[4], sizeUncompressed[5]); - qDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[6], sizeUncompressed[7], + tqDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[6], sizeUncompressed[7], sizeUncompressed[8], sizeUncompressed[9], sizeUncompressed[10] ); - qDebug( "Size dist of compressed blocks:" ); - qDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[0], sizeCompressed[1], + tqDebug( "Size dist of compressed blocks:" ); + tqDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[0], sizeCompressed[1], sizeCompressed[2], sizeCompressed[3], sizeCompressed[4], sizeCompressed[5]); - qDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[6], sizeCompressed[7], + tqDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[6], sizeCompressed[7], sizeCompressed[8], sizeCompressed[9], sizeCompressed[10] ); - qDebug( "===> total compression ratio %d/%d = %f", outOffset, size, (float)outOffset/(float)size ); - qDebug( "-----------------------------------------------------------" ); + tqDebug( "===> total compression ratio %d/%d = %f", outOffset, size, (float)outOffset/(float)size ); + tqDebug( "-----------------------------------------------------------" ); #endif return outarr; @@ -6061,7 +6061,7 @@ void TQPSPrinterPrivate::resetDrawingTools( TQPainter *paint ) if ( b != defaultBrush ) { if ( b == TQt::CustomPattern ) { #if defined(CHECK_RANGE) - qWarning( "TQPrinter: Pixmap brush not supported" ); + tqWarning( "TQPrinter: Pixmap brush not supported" ); #endif } else { cbrush = b; @@ -6171,7 +6171,7 @@ void TQPSPrinterPrivate::flushPage( bool last ) (last || buffer->size() > 50000000) #endif ) { -// qDebug("emiting header at page %d", pageCount ); +// tqDebug("emiting header at page %d", pageCount ); emitHeader( last ); } outStream << "%%Page: " @@ -6180,7 +6180,7 @@ void TQPSPrinterPrivate::flushPage( bool last ) << "QI\n"; if (!dirtyNewPage) { if ( pageFonts ) { - //qDebug("page fonts for page %d", pageCount); + //tqDebug("page fonts for page %d", pageCount); // we have already downloaded the header. Maybe we have page fonts here TQDictIterator<TQPSPrinterFontPrivate> it(fonts); while (it.current()) { @@ -6243,7 +6243,7 @@ static void ignoreSigPipe(bool b) return; // not ignoring sigpipe if (sigaction(SIGPIPE, users_sigpipe_handler, 0) == -1) - qWarning("TQPSPrinter: could not restore SIGPIPE handler"); + tqWarning("TQPSPrinter: could not restore SIGPIPE handler"); delete users_sigpipe_handler; users_sigpipe_handler = 0; @@ -6513,7 +6513,7 @@ bool TQPSPrinter::cmd( int c , TQPainter *paint, TQPDevCmdParam *p ) case PdcSetROP: #if defined(CHECK_RANGE) if ( p[0].ival != TQt::CopyROP ) - qWarning( "TQPrinter: Raster operation setting not supported" ); + tqWarning( "TQPrinter: Raster operation setting not supported" ); #endif break; case PdcSetBrushOrigin: @@ -6534,7 +6534,7 @@ bool TQPSPrinter::cmd( int c , TQPainter *paint, TQPDevCmdParam *p ) case PdcSetBrush: if ( p[0].brush->style() == TQt::CustomPattern ) { #if defined(CHECK_RANGE) - qWarning( "TQPrinter: Pixmap brush not supported" ); + tqWarning( "TQPrinter: Pixmap brush not supported" ); #endif return FALSE; } |