summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-11-14 22:40:52 (UTC)
committer kergoth <kergoth>2002-11-14 22:40:52 (UTC)
commitec92de66e81b145119ff15bea0ad88436eb7bd4b (patch) (unidiff)
treea65e8adc4edd60d7822f75e8b574e8e97596773c
parent3f1d60609657ea69bda453f5c820a23ee5375ab8 (diff)
downloadopie-ec92de66e81b145119ff15bea0ad88436eb7bd4b.zip
opie-ec92de66e81b145119ff15bea0ad88436eb7bd4b.tar.gz
opie-ec92de66e81b145119ff15bea0ad88436eb7bd4b.tar.bz2
namespace and include fix for uses of iostream in STL
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/kmolcalc.cpp2
-rw-r--r--noncore/games/kbill/MCursor.cc6
-rw-r--r--noncore/games/kbill/Picture.cc6
-rw-r--r--noncore/unsupported/qpdf/QOutputDev.cpp12
4 files changed, 14 insertions, 12 deletions
diff --git a/noncore/apps/oxygen/kmolcalc.cpp b/noncore/apps/oxygen/kmolcalc.cpp
index 33666b1..1d41b0f 100644
--- a/noncore/apps/oxygen/kmolcalc.cpp
+++ b/noncore/apps/oxygen/kmolcalc.cpp
@@ -1,51 +1,51 @@
1/* 1/*
2 * kmolcalc.cpp 2 * kmolcalc.cpp
3 * 3 *
4 * Copyright (C) 2000,2001 Tomislav Gountchev <tomi@idiom.com> 4 * Copyright (C) 2000,2001 Tomislav Gountchev <tomi@idiom.com>
5 * Copyright (C) 2002 Carsten Niehaus <cniehaus@handhelds.org> 5 * Copyright (C) 2002 Carsten Niehaus <cniehaus@handhelds.org>
6 */ 6 */
7 7
8/** 8/**
9 * KMOLCALC is the calculation engine. It knows about a hashtable of user defined atomic 9 * KMOLCALC is the calculation engine. It knows about a hashtable of user defined atomic
10 * weights and group definitions ELSTABLE, and the currently processed formula, stored 10 * weights and group definitions ELSTABLE, and the currently processed formula, stored
11 * as a list of elements and their coefficients, ELEMENTS. 11 * as a list of elements and their coefficients, ELEMENTS.
12 */ 12 */
13 13
14#include "kmolcalc.h" 14#include "kmolcalc.h"
15#include <qdict.h> 15#include <qdict.h>
16#include <qdir.h> 16#include <qdir.h>
17#include <qfile.h> 17#include <qfile.h>
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19#include <iostream.h> 19#include <iostream>
20 20
21 21
22/** 22/**
23 * Construct a new calculator object. 23 * Construct a new calculator object.
24 */ 24 */
25KMolCalc::KMolCalc() { 25KMolCalc::KMolCalc() {
26 elements = new ElementList; 26 elements = new ElementList;
27 elstable = NULL; 27 elstable = NULL;
28 readElstable(); 28 readElstable();
29} 29}
30 30
31KMolCalc::~KMolCalc() { 31KMolCalc::~KMolCalc() {
32 delete elements; 32 delete elements;
33} 33}
34 34
35void KMolCalc::readElstable() { 35void KMolCalc::readElstable() {
36 weight = -1; // not calculated yet 36 weight = -1; // not calculated yet
37 if (elstable) delete elstable; 37 if (elstable) delete elstable;
38 elstable = new QDict<SubUnit> (197, TRUE); 38 elstable = new QDict<SubUnit> (197, TRUE);
39 elstable->setAutoDelete(TRUE); 39 elstable->setAutoDelete(TRUE);
40 mwfile = QPEApplication::qpeDir() +"share/oxygen/kmolweights"; 40 mwfile = QPEApplication::qpeDir() +"share/oxygen/kmolweights";
41 QFile f(mwfile); 41 QFile f(mwfile);
42 if (f.exists()) readMwfile(f); 42 if (f.exists()) readMwfile(f);
43} 43}
44 44
45 45
46/** 46/**
47 * Parse a string S and construct the ElementList this->ELEMENTS, representing the 47 * Parse a string S and construct the ElementList this->ELEMENTS, representing the
48 * composition of S. Returns 0 if successful, or an error code (currently -1) if 48 * composition of S. Returns 0 if successful, or an error code (currently -1) if
49 * parsing failed. 49 * parsing failed.
50 * The elements is S must be valid element or group symbols, as stored in this->ELSTABLE. 50 * The elements is S must be valid element or group symbols, as stored in this->ELSTABLE.
51 * See help files for correct formula syntax. 51 * See help files for correct formula syntax.
diff --git a/noncore/games/kbill/MCursor.cc b/noncore/games/kbill/MCursor.cc
index 30f7577..a3cb340 100644
--- a/noncore/games/kbill/MCursor.cc
+++ b/noncore/games/kbill/MCursor.cc
@@ -1,69 +1,69 @@
1/*************************************************************************** 1/***************************************************************************
2 MCursor.cc - description 2 MCursor.cc - description
3 ------------------- 3 -------------------
4 begin : Thu Dec 30 1999 4 begin : Thu Dec 30 1999
5 copyright : (C) 1999 by Jurrien Loonstra 5 copyright : (C) 1999 by Jurrien Loonstra
6 email : j.h.loonstra@st.hanze.nl 6 email : j.h.loonstra@st.hanze.nl
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17#include "MCursor.h" 17#include "MCursor.h"
18#include "objects.h" 18#include "objects.h"
19 19
20#include <qcursor.h> 20#include <qcursor.h>
21#include <qbitmap.h> 21#include <qbitmap.h>
22#include <qwidget.h> 22#include <qwidget.h>
23#include <qstring.h> 23#include <qstring.h>
24#ifdef KDEVER 24#ifdef KDEVER
25#include <kapp.h> 25#include <kapp.h>
26#include <kstandarddirs.h> 26#include <kstandarddirs.h>
27#endif 27#endif
28#include <iostream.h> 28#include <iostream>
29#include <qpe/resource.h> 29#include <qpe/resource.h>
30MCursor::~MCursor() { 30MCursor::~MCursor() {
31 delete cursor; 31 delete cursor;
32} 32}
33 33
34void MCursor::load(const char *name, int masked) { 34void MCursor::load(const char *name, int masked) {
35 35
36 #ifdef KDEVER 36 #ifdef KDEVER
37 QString file, mfile; 37 QString file, mfile;
38 KStandardDirs dirs; 38 KStandardDirs dirs;
39 39
40 40
41 file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + ".xbm"); 41 file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + ".xbm");
42 42
43 QBitmap bitmap, mask; 43 QBitmap bitmap, mask;
44 if (bitmap.load(file) == FALSE) { 44 if (bitmap.load(file) == FALSE) {
45 cerr << "cannot open " << file << endl; 45 std::cerr << "cannot open " << file << std::endl;
46 exit(1); 46 exit(1);
47 } 47 }
48 if (masked == SEP_MASK) { 48 if (masked == SEP_MASK) {
49 // mfile.sprintf ("%sbitmaps/%s_mask.xbm", (const char*)dir, name); 49 // mfile.sprintf ("%sbitmaps/%s_mask.xbm", (const char*)dir, name);
50 mfile = file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm"); 50 mfile = file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm");
51 if (mask.load(mfile) == FALSE) { 51 if (mask.load(mfile) == FALSE) {
52 cerr << "cannot open " << file << endl; 52 std::cerr << "cannot open " << file << std::endl;
53 exit(1); 53 exit(1);
54 } 54 }
55 } 55 }
56 else 56 else
57 mask = bitmap; 57 mask = bitmap;
58 #endif 58 #endif
59 59
60 QBitmap bitmap, mask; 60 QBitmap bitmap, mask;
61 bitmap = Resource::loadBitmap("kbill/bitmaps/" + QString::fromLocal8Bit(name)); 61 bitmap = Resource::loadBitmap("kbill/bitmaps/" + QString::fromLocal8Bit(name));
62 62
63 if (masked == SEP_MASK) 63 if (masked == SEP_MASK)
64 mask = bitmap = Resource::loadBitmap("kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm"); 64 mask = bitmap = Resource::loadBitmap("kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm");
65 else 65 else
66 mask = bitmap; 66 mask = bitmap;
67 cursor = new QCursor(bitmap, mask, bitmap.width() / 2, bitmap.height() / 2); 67 cursor = new QCursor(bitmap, mask, bitmap.width() / 2, bitmap.height() / 2);
68} 68}
69 69
diff --git a/noncore/games/kbill/Picture.cc b/noncore/games/kbill/Picture.cc
index 79e19ba..fe0eff8 100644
--- a/noncore/games/kbill/Picture.cc
+++ b/noncore/games/kbill/Picture.cc
@@ -1,72 +1,72 @@
1/*************************************************************************** 1/***************************************************************************
2 Picture.cc - description 2 Picture.cc - description
3 ------------------- 3 -------------------
4 begin : Thu Dec 30 1999 4 begin : Thu Dec 30 1999
5 copyright : (C) 1999 by Jurrien Loonstra 5 copyright : (C) 1999 by Jurrien Loonstra
6 email : j.h.loonstra@st.hanze.nl 6 email : j.h.loonstra@st.hanze.nl
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17#include "Picture.h" 17#include "Picture.h"
18#include "objects.h" 18#include "objects.h"
19 19
20#include <iostream.h> 20#include <iostream>
21 21
22#include <qstring.h> 22#include <qstring.h>
23#include <qpe/resource.h> 23#include <qpe/resource.h>
24#ifdef KDEVER 24#ifdef KDEVER
25#include <kapp.h> 25#include <kapp.h>
26#include <kstandarddirs.h> 26#include <kstandarddirs.h>
27#include <kdebug.h> 27#include <kdebug.h>
28#endif 28#endif
29void Picture::load(const char *name, int index) { 29void Picture::load(const char *name, int index) {
30 //QString dir = KApplication::kde_datadir(), file; 30 //QString dir = KApplication::kde_datadir(), file;
31 // QString dir = locate("data",""),file; 31 // QString dir = locate("data",""),file;
32 // dir += "/kbill/"; 32 // dir += "/kbill/";
33 // if (index>=0) 33 // if (index>=0)
34 // file.sprintf ("%spixmaps/%s_%d.xpm", (const char *)dir, name, index); 34 // file.sprintf ("%spixmaps/%s_%d.xpm", (const char *)dir, name, index);
35 // else 35 // else
36 // file.sprintf("%spixmaps/%s.xpm", (const char *)dir, name); 36 // file.sprintf("%spixmaps/%s.xpm", (const char *)dir, name);
37#ifdef KDEVER 37#ifdef KDEVER
38 KStandardDirs dirs; 38 KStandardDirs dirs;
39 QString file; 39 QString file;
40 40
41 if (index>=0) { 41 if (index>=0) {
42 //kdDebug() << "Here"; 42 //kdDebug() << "Here";
43 QString sindex; 43 QString sindex;
44 sindex.setNum(index); 44 sindex.setNum(index);
45 // kdDebug() << "kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm"; 45 // kdDebug() << "kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm";
46 file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm"); 46 file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm");
47 } else { 47 } else {
48 file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + ".xpm"); 48 file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + ".xpm");
49 } 49 }
50 kdDebug() << file << endl; 50 kdDebug() << file << std::endl;
51 pix = new QPixmap(); 51 pix = new QPixmap();
52 if (pix->load(file) == FALSE) 52 if (pix->load(file) == FALSE)
53 cerr << "cannot open " << file << endl; 53 std::cerr << "cannot open " << file << std::endl;
54 width = pix->width(); 54 width = pix->width();
55 height = pix->height(); 55 height = pix->height();
56#endif 56#endif
57QString sindex; 57QString sindex;
58pix = new QPixmap(); 58pix = new QPixmap();
59sindex.setNum(index); 59sindex.setNum(index);
60if (index>=0) 60if (index>=0)
61pix->load(Resource::findPixmap("kbill/pixmaps/" + QString::fromLocal8Bit(name) +"_"+ sindex)); 61pix->load(Resource::findPixmap("kbill/pixmaps/" + QString::fromLocal8Bit(name) +"_"+ sindex));
62else 62else
63pix->load(Resource::findPixmap("kbill/pixmaps/" + QString::fromLocal8Bit(name))); 63pix->load(Resource::findPixmap("kbill/pixmaps/" + QString::fromLocal8Bit(name)));
64 64
65 width = pix->width(); 65 width = pix->width();
66 height = pix->height(); 66 height = pix->height();
67 67
68} 68}
69 69
70QPixmap* Picture::getPixmap() { 70QPixmap* Picture::getPixmap() {
71 return pix; 71 return pix;
72} 72}
diff --git a/noncore/unsupported/qpdf/QOutputDev.cpp b/noncore/unsupported/qpdf/QOutputDev.cpp
index f587a33..52237f5 100644
--- a/noncore/unsupported/qpdf/QOutputDev.cpp
+++ b/noncore/unsupported/qpdf/QOutputDev.cpp
@@ -1,53 +1,55 @@
1///======================================================================== 1///========================================================================
2// 2//
3// QOutputDev.cc 3// QOutputDev.cc
4// 4//
5// Copyright 1996 Derek B. Noonburg 5// Copyright 1996 Derek B. Noonburg
6// CopyRight 2002 Robert Griebl 6// CopyRight 2002 Robert Griebl
7// 7//
8//======================================================================== 8//========================================================================
9 9
10#ifdef __GNUC__ 10#ifdef __GNUC__
11#pragma implementation 11#pragma implementation
12#endif 12#endif
13 13
14#include <aconf.h> 14#include <aconf.h>
15#include <stdio.h> 15#include <stdio.h>
16#include <stdlib.h> 16#include <stdlib.h>
17#include <stddef.h> 17#include <stddef.h>
18#include <unistd.h> 18#include <unistd.h>
19#include <string.h> 19#include <string.h>
20#include <ctype.h> 20#include <ctype.h>
21#include <math.h> 21#include <math.h>
22#include <iostream>
23
22#include "GString.h" 24#include "GString.h"
23#include "Object.h" 25#include "Object.h"
24#include "Stream.h" 26#include "Stream.h"
25#include "Link.h" 27#include "Link.h"
26#include "GfxState.h" 28#include "GfxState.h"
27#include "GfxFont.h" 29#include "GfxFont.h"
28#include "UnicodeMap.h" 30#include "UnicodeMap.h"
29#include "CharCodeToUnicode.h" 31#include "CharCodeToUnicode.h"
30#include "FontFile.h" 32#include "FontFile.h"
31#include "Error.h" 33#include "Error.h"
32#include "TextOutputDev.h" 34#include "TextOutputDev.h"
33#include "QOutputDev.h" 35#include "QOutputDev.h"
34 36
35 37
36#include <qpixmap.h> 38#include <qpixmap.h>
37#include <qimage.h> 39#include <qimage.h>
38#include <qpainter.h> 40#include <qpainter.h>
39#include <qdict.h> 41#include <qdict.h>
40#include <qtimer.h> 42#include <qtimer.h>
41#include <qapplication.h> 43#include <qapplication.h>
42#include <qclipboard.h> 44#include <qclipboard.h>
43 45
44 //#define QPDFDBG(x) x // special debug mode 46 //#define QPDFDBG(x) x // special debug mode
45 #define QPDFDBG(x) // normal compilation 47 #define QPDFDBG(x) // normal compilation
46 48
47 49
48//------------------------------------------------------------------------ 50//------------------------------------------------------------------------
49// Constants and macros 51// Constants and macros
50//------------------------------------------------------------------------ 52//------------------------------------------------------------------------
51 53
52 54
53static inline QColor q_col ( const GfxRGB &rgb ) 55static inline QColor q_col ( const GfxRGB &rgb )
@@ -641,65 +643,65 @@ void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y,
641 for ( int i = 0; i < uLen; i++ ) { 643 for ( int i = 0; i < uLen; i++ ) {
642 QChar c = QChar ( u [i] ); 644 QChar c = QChar ( u [i] );
643 645
644 if ( fm. inFont ( c )) { 646 if ( fm. inFont ( c )) {
645 str [i] = QChar ( u [i] ); 647 str [i] = QChar ( u [i] );
646 } 648 }
647 else { 649 else {
648 str [i] = ' '; 650 str [i] = ' ';
649 QPDFDBG( printf ( "CHARACTER NOT IN FONT: %hx\n", c. unicode ( ))); 651 QPDFDBG( printf ( "CHARACTER NOT IN FONT: %hx\n", c. unicode ( )));
650 } 652 }
651 } 653 }
652 654
653 if (( uLen == 1 ) && ( str [0] == ' ' )) 655 if (( uLen == 1 ) && ( str [0] == ' ' ))
654 return; 656 return;
655 657
656 658
657 fp_t m11, m12, m21, m22; 659 fp_t m11, m12, m21, m22;
658 660
659 state-> getFontTransMat ( &m11, &m12, &m21, &m22 ); 661 state-> getFontTransMat ( &m11, &m12, &m21, &m22 );
660 m11 *= state-> getHorizScaling ( ); 662 m11 *= state-> getHorizScaling ( );
661 m12 *= state-> getHorizScaling ( ); 663 m12 *= state-> getHorizScaling ( );
662 664
663 fp_t fsize = m_painter-> font ( ). pixelSize ( ); 665 fp_t fsize = m_painter-> font ( ). pixelSize ( );
664 666
665#ifndef QT_NO_TRANSFORMATIONS 667#ifndef QT_NO_TRANSFORMATIONS
666 QWMatrix oldmat; 668 QWMatrix oldmat;
667 669
668 bool dorot = (( m12 < -0.1 ) || ( m12 > 0.1 )) && (( m21 < -0.1 ) || ( m21 > 0.1 )); 670 bool dorot = (( m12 < -0.1 ) || ( m12 > 0.1 )) && (( m21 < -0.1 ) || ( m21 > 0.1 ));
669 671
670 if ( dorot ) { 672 if ( dorot ) {
671 oldmat = m_painter-> worldMatrix ( ); 673 oldmat = m_painter-> worldMatrix ( );
672 674
673 cerr << endl << "ROTATED: " << m11 << ", " << m12 << ", " << m21 << ", " << m22 << " / SIZE: " << fsize << " / TEXT: " << str. local8Bit ( ) << endl << endl; 675 std::cerr << std::endl << "ROTATED: " << m11 << ", " << m12 << ", " << m21 << ", " << m22 << " / SIZE: " << fsize << " / TEXT: " << str. local8Bit ( ) << endl << endl;
674 676
675 QWMatrix mat ( lrint ( m11 / fsize ), lrint ( m12 / fsize ), -lrint ( m21 / fsize ), -lrint ( m22 / fsize ), lrint ( x1 ), lrint ( y1 )); 677 QWMatrix mat ( lrint ( m11 / fsize ), lrint ( m12 / fsize ), -lrint ( m21 / fsize ), -lrint ( m22 / fsize ), lrint ( x1 ), lrint ( y1 ));
676 678
677 m_painter-> setWorldMatrix ( mat ); 679 m_painter-> setWorldMatrix ( mat );
678 680
679 x1 = 0; 681 x1 = 0;
680 y1 = 0; 682 y1 = 0;
681 } 683 }
682#endif 684#endif
683 685
684 QPen oldpen = m_painter-> pen ( ); 686 QPen oldpen = m_painter-> pen ( );
685 687
686 if (!( state-> getRender ( ) & 1 )) { 688 if (!( state-> getRender ( ) & 1 )) {
687 QPen fillpen = oldpen; 689 QPen fillpen = oldpen;
688 690
689 fillpen. setColor ( m_painter-> brush ( ). color ( )); 691 fillpen. setColor ( m_painter-> brush ( ). color ( ));
690 m_painter-> setPen ( fillpen ); 692 m_painter-> setPen ( fillpen );
691 } 693 }
692 694
693 if ( fsize > 5 ) 695 if ( fsize > 5 )
694 m_painter-> drawText ( lrint ( x1 ), lrint ( y1 ), str ); 696 m_painter-> drawText ( lrint ( x1 ), lrint ( y1 ), str );
695 else 697 else
696 m_painter-> fillRect ( lrint ( x1 ), lrint ( y1 ), lrint ( QMAX( fp_t(1), dx1 )), lrint ( QMAX( fsize, dy1 )), m_painter-> pen ( ). color ( )); 698 m_painter-> fillRect ( lrint ( x1 ), lrint ( y1 ), lrint ( QMAX( fp_t(1), dx1 )), lrint ( QMAX( fsize, dy1 )), m_painter-> pen ( ). color ( ));
697 699
698 m_painter-> setPen ( oldpen ); 700 m_painter-> setPen ( oldpen );
699 701
700#ifndef QT_NO_TRANSFORMATIONS 702#ifndef QT_NO_TRANSFORMATIONS
701 if ( dorot ) 703 if ( dorot )
702 m_painter-> setWorldMatrix ( oldmat ); 704 m_painter-> setWorldMatrix ( oldmat );
703 #endif 705 #endif
704 706
705 QPDFDBG( printf ( "DRAW TEXT: \"%s\" at (%ld/%ld)\n", str. local8Bit ( ). data ( ), lrint ( x1 ), lrint ( y1 ))); 707 QPDFDBG( printf ( "DRAW TEXT: \"%s\" at (%ld/%ld)\n", str. local8Bit ( ). data ( ), lrint ( x1 ), lrint ( y1 )));
@@ -748,66 +750,66 @@ void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str,
748 750
749 uchar **scanlines = img. jumpTable ( ); 751 uchar **scanlines = img. jumpTable ( );
750 752
751 if ( ctm [3] > 0 ) 753 if ( ctm [3] > 0 )
752 scanlines += ( height - 1 ); 754 scanlines += ( height - 1 );
753 755
754 for ( int y = 0; y < height; y++ ) { 756 for ( int y = 0; y < height; y++ ) {
755 QRgb *scanline = (QRgb *) *scanlines; 757 QRgb *scanline = (QRgb *) *scanlines;
756 758
757 if ( ctm [0] < 0 ) 759 if ( ctm [0] < 0 )
758 scanline += ( width - 1 ); 760 scanline += ( width - 1 );
759 761
760 for ( int x = 0; x < width; x++ ) { 762 for ( int x = 0; x < width; x++ ) {
761 Guchar alpha; 763 Guchar alpha;
762 764
763 imgStr-> getPixel ( &alpha ); 765 imgStr-> getPixel ( &alpha );
764 766
765 if ( invert ) 767 if ( invert )
766 alpha ^= 1; 768 alpha ^= 1;
767 769
768 *scanline = ( alpha == 0 ) ? 0xff000000 | val : val; 770 *scanline = ( alpha == 0 ) ? 0xff000000 | val : val;
769 771
770 ctm [0] < 0 ? scanline-- : scanline++; 772 ctm [0] < 0 ? scanline-- : scanline++;
771 } 773 }
772 ctm [3] > 0 ? scanlines-- : scanlines++; 774 ctm [3] > 0 ? scanlines-- : scanlines++;
773 775
774 qApp-> processEvents ( ); 776 qApp-> processEvents ( );
775 } 777 }
776 778
777 #ifndef QT_NO_TRANSFORMATIONS 779 #ifndef QT_NO_TRANSFORMATIONS
778 QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] ); 780 QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] );
779 781
780 cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << endl 782 std::cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << std::endl
781 << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << endl; 783 << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << std::endl;
782 784
783 QWMatrix oldmat = m_painter-> worldMatrix ( ); 785 QWMatrix oldmat = m_painter-> worldMatrix ( );
784 m_painter-> setWorldMatrix ( mat, true ); 786 m_painter-> setWorldMatrix ( mat, true );
785 787
786#ifdef QWS 788#ifdef QWS
787 QPixmap pm; 789 QPixmap pm;
788 pm. convertFromImage ( img ); 790 pm. convertFromImage ( img );
789 m_painter-> drawPixmap ( 0, 0, pm ); 791 m_painter-> drawPixmap ( 0, 0, pm );
790#else 792#else
791 m_painter-> drawImage ( QPoint ( 0, 0 ), img ); 793 m_painter-> drawImage ( QPoint ( 0, 0 ), img );
792#endif 794#endif
793 795
794 m_painter-> setWorldMatrix ( oldmat ); 796 m_painter-> setWorldMatrix ( oldmat );
795 797
796#else 798#else
797 if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { 799 if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) {
798 QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); 800 QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" ));
799 } 801 }
800 else { 802 else {
801 int x = lrint ( ctm [4] ); 803 int x = lrint ( ctm [4] );
802 int y = lrint ( ctm [5] ); 804 int y = lrint ( ctm [5] );
803 805
804 int w = lrint ( ctm [0] ); 806 int w = lrint ( ctm [0] );
805 int h = lrint ( ctm [3] ); 807 int h = lrint ( ctm [3] );
806 808
807 if ( w < 0 ) { 809 if ( w < 0 ) {
808 x += w; 810 x += w;
809 w = -w; 811 w = -w;
810 } 812 }
811 if ( h < 0 ) { 813 if ( h < 0 ) {
812 y += h; 814 y += h;
813 h = -h; 815 h = -h;
@@ -877,66 +879,66 @@ void QOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, int wi
877 QRgb *scanline = (QRgb *) *scanlines; 879 QRgb *scanline = (QRgb *) *scanlines;
878 880
879 if ( ctm [0] < 0 ) 881 if ( ctm [0] < 0 )
880 scanline += ( width - 1 ); 882 scanline += ( width - 1 );
881 883
882 for ( int x = 0; x < width; x++ ) { 884 for ( int x = 0; x < width; x++ ) {
883 imgStr-> getPixel ( pixBuf ); 885 imgStr-> getPixel ( pixBuf );
884 colorMap-> getRGB ( pixBuf, &rgb ); 886 colorMap-> getRGB ( pixBuf, &rgb );
885 887
886 uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff ); 888 uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff );
887 889
888 if ( maskColors ) { 890 if ( maskColors ) {
889 for ( int k = 0; k < nComps; ++k ) { 891 for ( int k = 0; k < nComps; ++k ) {
890 if (( pixBuf [k] < maskColors [2 * k] ) || ( pixBuf [k] > maskColors [2 * k] )) { 892 if (( pixBuf [k] < maskColors [2 * k] ) || ( pixBuf [k] > maskColors [2 * k] )) {
891 val |= 0xff000000; 893 val |= 0xff000000;
892 break; 894 break;
893 } 895 }
894 } 896 }
895 } 897 }
896 *scanline = val; 898 *scanline = val;
897 899
898 ctm [0] < 0 ? scanline-- : scanline++; 900 ctm [0] < 0 ? scanline-- : scanline++;
899 } 901 }
900 ctm [3] > 0 ? scanlines-- : scanlines++; 902 ctm [3] > 0 ? scanlines-- : scanlines++;
901 903
902 qApp-> processEvents ( ); 904 qApp-> processEvents ( );
903 } 905 }
904 906
905 907
906 #ifndef QT_NO_TRANSFORMATIONS 908 #ifndef QT_NO_TRANSFORMATIONS
907 QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] ); 909 QWMatrix mat ( ctm [0] / width, ctm [1], ctm [2], ctm [3] / height, ctm [4], ctm [5] );
908 910
909 cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << endl 911 std::cerr << "MATRIX T=" << mat. dx ( ) << "/" << mat. dy ( ) << std::endl
910 << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << endl; 912 << " - M=" << mat. m11 ( ) << "/" << mat. m12 ( ) << "/" << mat. m21 ( ) << "/" << mat. m22 ( ) << std::endl;
911 913
912 QWMatrix oldmat = m_painter-> worldMatrix ( ); 914 QWMatrix oldmat = m_painter-> worldMatrix ( );
913 m_painter-> setWorldMatrix ( mat, true ); 915 m_painter-> setWorldMatrix ( mat, true );
914 916
915#ifdef QWS 917#ifdef QWS
916 QPixmap pm; 918 QPixmap pm;
917 pm. convertFromImage ( img ); 919 pm. convertFromImage ( img );
918 m_painter-> drawPixmap ( 0, 0, pm ); 920 m_painter-> drawPixmap ( 0, 0, pm );
919 #else 921 #else
920 m_painter-> drawImage ( QPoint ( 0, 0 ), img ); 922 m_painter-> drawImage ( QPoint ( 0, 0 ), img );
921#endif 923#endif
922 924
923 m_painter-> setWorldMatrix ( oldmat ); 925 m_painter-> setWorldMatrix ( oldmat );
924 926
925#else // QT_NO_TRANSFORMATIONS 927#else // QT_NO_TRANSFORMATIONS
926 928
927 if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { 929 if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) {
928 QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); 930 QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" ));
929 } 931 }
930 else { 932 else {
931 int x = lrint ( ctm [4] ); 933 int x = lrint ( ctm [4] );
932 int y = lrint ( ctm [5] ); 934 int y = lrint ( ctm [5] );
933 935
934 int w = lrint ( ctm [0] ); 936 int w = lrint ( ctm [0] );
935 int h = lrint ( ctm [3] ); 937 int h = lrint ( ctm [3] );
936 938
937 if ( w < 0 ) { 939 if ( w < 0 ) {
938 x += w; 940 x += w;
939 w = -w; 941 w = -w;
940 } 942 }
941 if ( h < 0 ) { 943 if ( h < 0 ) {
942 y += h; 944 y += h;