less qt3/kde3 support

svn path=/branches/work/kde4/playground/graphics/okular/; revision=524525
remotes/origin/old/work/newpageview
Pino Toscano 20 years ago
parent 8683df0416
commit 11d5e77ff4
  1. 2
      core/page.cpp
  2. 4
      generators/fax/faxrenderer.cpp
  3. 38
      generators/ghostview/generator_ghostview.cpp
  4. 26
      generators/ghostview/gvlogwindow.cpp
  5. 6
      generators/ghostview/internaldocument.cpp
  6. 48
      generators/ghostview/interpreter_cmd.cpp
  7. 4
      generators/ghostview/interpreter_cmd.h
  8. 8
      generators/ghostview/kpdflibgsasyncgenerator.cpp
  9. 2
      generators/kimgio/generator_kimgio.cpp
  10. 4
      generators/poppler/generator_pdf.cpp
  11. 10
      generators/poppler/gp_outputdev.cpp
  12. 11
      part.cpp
  13. 7
      ui/pageview.cpp
  14. 4
      ui/pageviewutils.cpp
  15. 4
      ui/presentationwidget.cpp
  16. 5
      ui/searchwidget.cpp
  17. 5
      ui/side_reviews.cpp

@ -380,7 +380,7 @@ void KPDFPage::saveLocalContents( QDomNode & parentNode, QDomDocument & document
gettimeofday( &te, NULL );
double startTime = (double)ts.tv_sec + ((double)ts.tv_usec) / 1000000.0;
double endTime = (double)te.tv_sec + ((double)te.tv_usec) / 1000000.0;
kdDebug() << "annots: XML Save Time: " << (endTime-startTime)*1000.0 << "ms" << endl;
kDebug() << "annots: XML Save Time: " << (endTime-startTime)*1000.0 << "ms" << endl;
#endif
}

@ -53,7 +53,7 @@ void FaxRenderer::generatePixmap( PixmapRequest * request )
QPixmap* pix = new QPixmap(request->width,request->height);
pix->fill();
QPainter p(pix);
QImage img = fax.page(request->pageNumber).smoothScale(request->width,request->height);
QImage img = fax.page(request->pageNumber).scaled(request->width,request->height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
p.drawImage( 0,0, img, 0,0,img.width(),img.height());
/*
SimplePageSize psize = pageSizes[page->getPageNumber() - 1];
@ -72,7 +72,7 @@ void FaxRenderer::generatePixmap( PixmapRequest * request )
int width_in_pixel = qRound(resolution * psize.width().getLength_in_inch());
int height_in_pixel = qRound(resolution * psize.height().getLength_in_inch());
img = img.smoothScale(width_in_pixel, height_in_pixel);
img = img.scaled(width_in_pixel, height_in_pixel, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
foreGroundPaint->drawImage(0, 0, img);
page->returnPainter(foreGroundPaint);
}

@ -221,15 +221,15 @@ bool GSGenerator::loadDocument( const QString & fileName, QValueVector< KPDFPage
void GSGenerator::slotPixmapGenerated(const QImage* img)
{
kdWarning() << "SlotSyncGenerated! - finished m_sRequest id=" << m_sRequest->id << " " <<m_sRequest->width << "x" << m_sRequest->height << "@" << m_sRequest->pageNumber << " async == " << m_sRequest->async << endl;
kdWarning() << "sync gen is ready:" << pixGenerator->ready() << endl;
kWarning() << "SlotSyncGenerated! - finished m_sRequest id=" << m_sRequest->id << " " <<m_sRequest->width << "x" << m_sRequest->height << "@" << m_sRequest->pageNumber << " async == " << m_sRequest->async << endl;
kWarning() << "sync gen is ready:" << pixGenerator->ready() << endl;
QPixmap * rPix;
rPix = new QPixmap(img->size());
rPix->fill();
QPainter p(rPix);
p.drawImage(0,0,*img,0,0,img->width(),img->height());
p.end();
kdWarning() << "unlocking \n";
kWarning() << "unlocking \n";
syncLock.unlock();
m_sRequest->page->setPixmap( m_sRequest->id, rPix );
signalRequestDone( m_sRequest );
@ -238,7 +238,7 @@ void GSGenerator::slotPixmapGenerated(const QImage* img)
void GSGenerator::slotAsyncPixmapGenerated(QPixmap * pix)
{
docLock.unlock();
kdWarning() << "SlotASyncGenerated!\n";
kWarning() << "SlotASyncGenerated!\n";
m_asRequest->page->setPixmap( m_asRequest->id, pix );
signalRequestDone( m_asRequest );
}
@ -302,7 +302,7 @@ bool GSGenerator::loadPages( QValueVector< KPDFPage * > & pagesVector )
tmpPage=(internalDoc->dsc() -> page() + i);
if (!tmpPage)
{
kdDebug() << "no tmpPage for page nr " << i << endl;
kDebug() << "no tmpPage for page nr " << i << endl;
continue;
}
pSize = internalDoc -> computePageSize( internalDoc -> pageMedia( i ) );
@ -336,7 +336,7 @@ bool GSGenerator::initInterpreter()
{
if( pixGenerator->start(true) && internalDoc->dsc()->isStructured() )
{
kdWarning() << "setStructure\n";
kWarning() << "setStructure\n";
// this 0 is ok here, we will not be getting a PAGE anwser from those
pixGenerator->run ( internalDoc->file() , internalDoc->prolog(), false);
pixGenerator->run ( internalDoc->file() , internalDoc->setup(), false );
@ -349,13 +349,13 @@ bool GSGenerator::loadDocumentWithDSC( QString & name, QValueVector< KPDFPage *
{
internalDoc = new GSInternalDocument (name, ps ? GSInternalDocument::PS : GSInternalDocument::PDF);
pagesVector.resize( internalDoc->dsc()->page_count() );
kdDebug() << "Page count: " << internalDoc->dsc()->page_count() << endl;
kDebug() << "Page count: " << internalDoc->dsc()->page_count() << endl;
return loadPages (pagesVector);
}
void GSGenerator::generatePixmap( PixmapRequest * req )
{
kdWarning() << "receiving req id=" << req->id << " " <<req->width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl;
kWarning() << "receiving req id=" << req->id << " " <<req->width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl;
int pgNo=req->pageNumber;
if (!req->async)
return;
@ -363,32 +363,32 @@ void GSGenerator::generatePixmap( PixmapRequest * req )
{
docLock.lock();
m_asRequest=req;
kdWarning() << "setOrientation\n";
kWarning() << "setOrientation\n";
asyncGenerator->setOrientation(rotation (internalDoc->orientation(pgNo)));
// asyncGenerator->setBoundingBox( internalDoc->boundingBox(i));
kdWarning() << "setSize\n";
kWarning() << "setSize\n";
asyncGenerator->setSize(req->width ,req->height);
kdWarning() << "setMedia\n";
kWarning() << "setMedia\n";
asyncGenerator->setMedia( internalDoc -> getPaperSize ( internalDoc -> pageMedia( pgNo )) );
kdWarning() << "setMagnify\n";
kWarning() << "setMagnify\n";
asyncGenerator->setMagnify(qMax(static_cast<double>(req->width)/req->page->width() ,
static_cast<double>(req->height)/req->page->height()));
GSInterpreterLib::Position u=internalDoc->pagePos(pgNo);
// kdWarning () << "Page pos is " << pgNo << ":"<< u.first << "/" << u.second << endl;
// kWarning () << "Page pos is " << pgNo << ":"<< u.first << "/" << u.second << endl;
if (!asyncGenerator->running())
{
if ( internalDoc->dsc()->isStructured() )
{
kdWarning() << "setStructure\n";
kWarning() << "setStructure\n";
asyncGenerator->setStructure( internalDoc->prolog() , internalDoc->setup() );
}
if (!asyncGenerator->running())
{
kdWarning() << "start after structure\n";
kWarning() << "start after structure\n";
asyncGenerator->startInterpreter();
}
}
kdWarning() << "run pagepos\n";
kWarning() << "run pagepos\n";
asyncGenerator->run (internalDoc->pagePos(pgNo));
}
else
@ -414,8 +414,8 @@ void GSGenerator::generatePixmap( PixmapRequest * req )
/* connect (pixGenerator, SIGNAL (Finished(const QImage*)),
this, SLOT(slotPixmapGenerated (const QImage*)));*/
this->m_sRequest=req;
kdWarning() << "checking req id=" << req->id << " " <<req->width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl;
kdWarning() << "generator running : " << pixGenerator->running() << endl;
kWarning() << "checking req id=" << req->id << " " <<req->width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl;
kWarning() << "generator running : " << pixGenerator->running() << endl;
pixGenerator->run ( internalDoc->file() , internalDoc->pagePos(pgNo),true);
}
@ -424,7 +424,7 @@ kdWarning() << "generator running : " << pixGenerator->running() << endl;
bool GSGenerator::canGeneratePixmap( bool async )
{
// kdWarning () << "ready Async/Sync " << (! docLock.locked()) << "/ " << (( pixGenerator ) ? !syncLock.locked() : true) << " asking for async: " << async << endl;
// kWarning () << "ready Async/Sync " << (! docLock.locked()) << "/ " << (( pixGenerator ) ? !syncLock.locked() : true) << " asking for async: " << async << endl;
if (async) return !docLock.locked();
return ( pixGenerator ) ? pixGenerator->ready() && !syncLock.locked() : true;
}

@ -25,7 +25,7 @@ GSLogWindow::GSLogWindow( const QString& caption,
QWidget* parent, const char* name) :
QVBox ( parent, name )
{
kdDebug() << "Starting logwindow" <<endl;
kDebug() << "Starting logwindow" <<endl;
m_searchLine = new KListViewSearchLine(this);
m_msgList = new KListView(this);
@ -48,7 +48,7 @@ bool GSLogWindow::event( QEvent * event )
if ( event->type() == QEvent::Reparent && ( m_msgList->childCount() ) )
{
int w=( m_msgList->firstChild() ) -> width( m_msgList->fontMetrics() , m_msgList, m_tCol);
kdDebug() << "new width = " << w << endl;
kDebug() << "new width = " << w << endl;
m_msgList->setColumnWidth(m_tCol, w);
}
return true;
@ -56,8 +56,8 @@ bool GSLogWindow::event( QEvent * event )
void GSLogWindow::append( GSInterpreterLib::MessageType t, const QString &text)
{
//kdDebug() << "Appending: " << text <<endl;
kdDebug() << "last int: " << m_lastInt << endl;
//kDebug() << "Appending: " << text <<endl;
kDebug() << "last int: " << m_lastInt << endl;
QStringList l=QStringList::split("\n",text.stripWhiteSpace());
QStringList::Iterator it=l.begin(), end=l.end();
while (it!=end)
@ -88,15 +88,15 @@ void GSLogWindow::append( GSInterpreterLib::MessageType t, const char* buf, int
// ghostscript splits messages longer then 128 to chunks, handle this properly
if (m_lastInt == 128)
{
kdDebug() << "last was full line" << endl;
kDebug() << "last was full line" << endl;
if (t==m_buffer.first)
{
kdDebug() << "appending to buffer" << endl;
kDebug() << "appending to buffer" << endl;
m_buffer.second +=QString::fromLocal8Bit( buf, num );
}
else
{
kdDebug() << "appending from buffer" << endl;
kDebug() << "appending from buffer" << endl;
// sets m_lastInt to 0
appendBuffered();
}
@ -104,10 +104,10 @@ void GSLogWindow::append( GSInterpreterLib::MessageType t, const char* buf, int
if (num==128)
{
kdDebug() << "this is full line" << endl;
kDebug() << "this is full line" << endl;
if (m_lastInt != 128)
{
kdDebug() << "appending to buffer" << endl;
kDebug() << "appending to buffer" << endl;
m_buffer.first=t;
m_buffer.second=QString::fromLocal8Bit( buf, num );
}
@ -116,22 +116,22 @@ void GSLogWindow::append( GSInterpreterLib::MessageType t, const char* buf, int
}
else
{
kdDebug() << "this is normal line" << endl;
kDebug() << "this is normal line" << endl;
if (m_lastInt == 128)
{
kdDebug() << "appending from buffer" << endl;
kDebug() << "appending from buffer" << endl;
appendBuffered();
}
else
{
kdDebug() << "appending directly" << endl;
kDebug() << "appending directly" << endl;
append(t,QString::fromLocal8Bit( buf, num ));
m_clearTimer.stop();
}
}
m_lastInt=num;
// kdDebug()<< "LogWindow before split: " << msgString << " lenght" << num << endl;
// kDebug()<< "LogWindow before split: " << msgString << " lenght" << num << endl;
}

@ -102,7 +102,7 @@ GSInternalDocument::GSInternalDocument(QString fname, Format form) : m_format (f
}
if (m_error)
kdDebug(4656) << m_errorString << endl;
kDebug(4656) << m_errorString << endl;
}
@ -239,7 +239,7 @@ QString GSInternalDocument::getPaperSize( const QString& mediaName ) const
m++;
}
// should never happen as we have fallback
kdDebug(4656) << "UNABLE TO FIND PAPER SIZE FOR MEDIA NAME: " << mediaName << endl;
kDebug(4656) << "UNABLE TO FIND PAPER SIZE FOR MEDIA NAME: " << mediaName << endl;
return QString("a4");
}
return QString(r->name);
@ -406,7 +406,7 @@ bool GSInternalDocument::psCopyDoc( const QString& inputFile,
unsigned int pages = 0;
long here;
kdDebug(4656) << "Copying pages from " << inputFile << " to "
kDebug(4656) << "Copying pages from " << inputFile << " to "
<< outputFile << endl;
from = fopen( QFile::encodeName( inputFile ), "r" );

@ -59,7 +59,7 @@ ProcessData :: ~ProcessData()
QPixmap* GSInterpreterCMD::takePixmap()
{
kdDebug(4655) << "taking pixmap" << endl;
kDebug(4655) << "taking pixmap" << endl;
QPixmap * x=m_pixmap;
m_pixmap=0;
return x;
@ -76,7 +76,7 @@ GSInterpreterCMD::GSInterpreterCMD( const QString & fileName ) :
m_aaText (1),
m_pfonts (false)
{
kdDebug(4655) << "Constructing async interpreter!" << endl;
kDebug(4655) << "Constructing async interpreter!" << endl;
m_pixmap=0;
}
@ -106,18 +106,18 @@ GSInterpreterCMD::~GSInterpreterCMD()
void GSInterpreterCMD::destroyInternalProcess(KProcess * stop)
{
pid_t pId=stop->pid();
kdDebug(4655) << "Destroy thread pid " << getpid() << " of " << pId << endl;
kDebug(4655) << "Destroy thread pid " << getpid() << " of " << pId << endl;
int x=1;
ProcessData *mem=m_stoppingPids[pId];
write(mem->fds[0],&x,sizeof(int));
stop->wait();
kdDebug(4655) << "Normal exit : " << !stop->isRunning() << endl;
kDebug(4655) << "Normal exit : " << !stop->isRunning() << endl;
// give it the time to close the interpreter before we kill it
if( stop->isRunning() )
{
stop->kill();
stop->wait(5);
kdDebug(4655) << "after stopping, the proces running: "
kDebug(4655) << "after stopping, the proces running: "
<< stop->isRunning() << endl;
if( stop->isRunning() )
stop->kill( SIGKILL );
@ -131,19 +131,19 @@ bool GSInterpreterCMD::running ()
{
if (m_process==0)
{
kdDebug (4655) << "no process\n";
kDebug (4655) << "no process\n";
return false;
}
else
{
kdDebug(4655) << "running " << m_process->isRunning() << endl;
kDebug(4655) << "running " << m_process->isRunning() << endl;
return m_process->isRunning();
}
}
void GSInterpreterCMD::setStructure(GSInterpreterLib::Position prolog, GSInterpreterLib::Position setup)
{
kdDebug(4655) << "setStructure()" << endl;
kDebug(4655) << "setStructure()" << endl;
m_structurePending=true;
m_data[0]=prolog;
m_data[1]=setup;
@ -151,7 +151,7 @@ void GSInterpreterCMD::setStructure(GSInterpreterLib::Position prolog, GSInterpr
bool GSInterpreterCMD::stop(bool async)
{
kdDebug(4655) << "stop()" << endl;
kDebug(4655) << "stop()" << endl;
// if( !_interpreterBusy ) return;
if ( running() )
@ -161,7 +161,7 @@ bool GSInterpreterCMD::stop(bool async)
KProcess * stop=m_process;
m_stoppingPids.insert ( stop->pid(), m_processData );
m_process=0;
kdDebug(4655) << "Launching destroy thread" << endl;
kDebug(4655) << "Launching destroy thread" << endl;
if (!async)
destroyInternalProcess(stop);
else
@ -186,10 +186,10 @@ bool GSInterpreterCMD::stop(bool async)
bool GSInterpreterCMD::startInterpreter()
{
kdDebug(4655) << "start()" << endl;
kDebug(4655) << "start()" << endl;
if ( m_process && m_process->isRunning() )
{
kdDebug(4655) << "ERROR: starting an interpreter while one is running" << endl;
kDebug(4655) << "ERROR: starting an interpreter while one is running" << endl;
return false;
}
@ -211,7 +211,7 @@ bool GSInterpreterCMD::startInterpreter()
<< QString::number (m_aaText)
<< QString::number (m_aaGfx);
kdDebug(4655) << "Argument count: " << list.count() << endl;
kDebug(4655) << "Argument count: " << list.count() << endl;
(*m_process) << list;
/*connect( m_process, SIGNAL( processExited( KProcess* ) ),
this, SLOT( slotProcessExited( KProcess* ) ) );
@ -223,12 +223,12 @@ bool GSInterpreterCMD::startInterpreter()
this, SLOT( gs_input( KProcess* ) ) );*/
// Finally fire up the interpreter.
// kdDebug(4500) << "KPSWidget: starting interpreter" << endl;
// kDebug(4500) << "KPSWidget: starting interpreter" << endl;
if( m_process->start( KProcess::NotifyOnExit,
/*m_usePipe ?*/ KProcess::All /*: KProcess::AllOutput*/ ) )
{
kdDebug(4655) << "Starting async! " << m_process->pid() << endl;
kDebug(4655) << "Starting async! " << m_process->pid() << endl;
return true;
}
else
@ -236,7 +236,7 @@ bool GSInterpreterCMD::startInterpreter()
emit error(i18n( "Could not start kpdf's libgs helper application. This is most likely "
"caused by kpdflibgsasyncgenerator not being installed, or installed to a "
"directory not listed in the environment PATH variable."),0);
kdDebug(4655) << "Could not start helper" << endl;
kDebug(4655) << "Could not start helper" << endl;
return false;
}
}
@ -322,7 +322,7 @@ void GSInterpreterCMD::setAABits(int text, int graphics)
bool GSInterpreterCMD::run( GSInterpreterLib::Position pos)
{
kdDebug(4655) << "Running request with size: " << m_width << "x" << m_height << endl;
kDebug(4655) << "Running request with size: " << m_width << "x" << m_height << endl;
if( !running() )
return false;
@ -330,7 +330,7 @@ bool GSInterpreterCMD::run( GSInterpreterLib::Position pos)
lock();
if ( m_pixmap != 0 )
{
kdDebug(4655) << "ERROR DELETING PIXMAP, THIS SHOULD NOT HAPPEN" << endl;
kDebug(4655) << "ERROR DELETING PIXMAP, THIS SHOULD NOT HAPPEN" << endl;
delete m_pixmap;
}
// the pixmap to which the generated image will be copied
@ -347,13 +347,13 @@ bool GSInterpreterCMD::run( GSInterpreterLib::Position pos)
void GSInterpreterCMD::run()
{
// we are inside a thread
kdDebug(4655)<< "Generation thread started " << getpid() << endl;
kDebug(4655)<< "Generation thread started " << getpid() << endl;
int x;
// pending structural information -> send them
if (m_structurePending)
{
kdDebug(4655) << "sending structural data" << endl;
kDebug(4655) << "sending structural data" << endl;
PageInfo pageInf;
for (int i=0;i<2;i++)
{
@ -367,7 +367,7 @@ void GSInterpreterCMD::run()
}
m_structurePending=false;
}
kdDebug(4655)<< "sending page request" << endl;
kDebug(4655)<< "sending page request" << endl;
// Communication with the helper looks like this
// 1. Sendign a 0 to helper telling it to start a function that processes the request
x=0;
@ -378,10 +378,10 @@ void GSInterpreterCMD::run()
// the helper will copy the pixmap using XCopyArea
read ( m_processData->fds[1], &x, sizeof(int) );
unlock();
kdDebug(4655)<< "pximap ready" << endl;
kDebug(4655)<< "pximap ready" << endl;
if (x==3)
{
kdDebug(4655)<< "sending the pximap to generator" << endl;
kDebug(4655)<< "sending the pximap to generator" << endl;
// inform interpreter about PixmaRequest being done
QCustomEvent * readyEvent = new QCustomEvent( GS_DATAREADY_ID );
// set sth just to send nonempty
@ -397,7 +397,7 @@ void GSInterpreterCMD::customEvent( QCustomEvent * e )
{
if (e->type() == GS_DATAREADY_ID )
{
kdWarning() << "emitting signal" << endl;
kWarning() << "emitting signal" << endl;
QPixmap *pix=takePixmap();
emit Finished(pix);

@ -48,8 +48,8 @@ class GSInterpreterCMD : public QObject , public QThread
bool stop(bool async=true);
bool ready() { return !interpreterLock.locked() ; } ;
bool running ();
void lock() { kdDebug() << "locking async\n"; interpreterLock.lock() ; } ;
void unlock() { kdDebug() << "unlocking async\n"; interpreterLock.unlock() ; } ;
void lock() { kDebug() << "locking async\n"; interpreterLock.lock() ; } ;
void unlock() { kDebug() << "unlocking async\n"; interpreterLock.unlock() ; } ;
// void setGhostscriptArguments( const QStringList& arguments );
void setOrientation( int orientation );

@ -36,9 +36,9 @@ FILE * f;
void PixHandler::slotPixmap(const QImage* img)
{
QPixmap *pix=new QPixmap();
kdWarning() << "img size/depth " << img->size() << "/" <<img->depth() << endl;
kWarning() << "img size/depth " << img->size() << "/" <<img->depth() << endl;
bool done=pix->convertFromImage(*img);
kdWarning () << "Conversion from qimage " << done << endl;
kWarning () << "Conversion from qimage " << done << endl;
// QDialog t;
// t.resize(pix->width(),pix->height());
// t.setBackgroundPixmap(*pix);
@ -70,7 +70,7 @@ void process()
if ( ! ( interpreter->running() ) )
interpreter->start(false);
// kdDebug() << "Processing: " << pData.sync << endl;
// kDebug() << "Processing: " << pData.sync << endl;
interpreter-> run ( f, pData.pos, pData.sync );
if (! pData.sync )
{
@ -85,7 +85,7 @@ int main (int argc, char* argv[])
// Order of argv: fileName, msgQueueId, media type, magnify, orientation
for (int i=0;i<argc;i++)
kdDebug() << "arg nr " << i << " : " << QCString(argv[i]) << endl;
kDebug() << "arg nr " << i << " : " << QCString(argv[i]) << endl;
f = fopen ( argv[1] , "r");
interpreter=new GSInterpreterLib();

@ -46,7 +46,7 @@ bool KIMGIOGenerator::canGeneratePixmap( bool /* async */ )
void KIMGIOGenerator::generatePixmap( PixmapRequest * request )
{
// perform a smooth scaled generation
QImage smoothImage = m_pix->convertToImage().smoothScale( request->width, request->height );
QImage smoothImage = m_pix->convertToImage().scaled( request->width, request->height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
QPixmap * p = new QPixmap( smoothImage );
request->page->setPixmap(request->id, p);

@ -543,7 +543,7 @@ bool PDFGenerator::print( KPrinter& printer )
// size not supported by Qt, KPrinter gives us the size as wWIDTHhHEIGHT
// remove the w
ps = ps.mid(1);
int hPos = ps.find("h");
int hPos = ps.indexOf("h");
globalParams->setPSPaperWidth(ps.left(hPos).toInt());
globalParams->setPSPaperHeight(ps.mid(hPos+1).toInt());
}
@ -1334,7 +1334,7 @@ void PDFGenerator::addAnnotations( Page * pdfPage, KPDFPage * page )
XPDFReader::lookupName( annotDict, "Name", t->textIcon );
if ( !t->textIcon.isEmpty() )
{
t->textIcon = t->textIcon.lower();
t->textIcon = t->textIcon.toLower();
t->textIcon.remove( ' ' );
}
// request for postprocessing window geometry

@ -3,7 +3,7 @@
* <Christophe.Devriese@student.kuleuven.ac.be> *
* Copyright (C) 2003 by Andy Goossens <andygoossens@telenet.be> *
* Copyright (C) 2003 by Scott Wheeler <wheeler@kde.org> *
* Copyright (C) 2003 by Ingo Klöcker <kloecker@kde.org> *
* Copyright (C) 2003 by Ingo Kl<EFBFBD>ker <kloecker@kde.org> *
* Copyright (C) 2003 by Will Andrews <will@csociety.org> *
* Copyright (C) 2004 by Dominique Devriese <devriese@kde.org> *
* Copyright (C) 2004 by Waldo Bastian <bastian@kde.org> *
@ -121,7 +121,7 @@ void KPDFOutputDev::endPage()
delete m_image;
// it may happen (in fact it doesn't) that we need a rescaling
if ( bw != m_pixmapWidth && bh != m_pixmapHeight )
m_image = new QImage( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) );
m_image = new QImage( img->scaled( m_pixmapWidth, m_pixmapHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
else
// dereference image from the xpdf memory
m_image = new QImage( img->copy() );
@ -131,7 +131,7 @@ void KPDFOutputDev::endPage()
delete m_pixmap;
// it may happen (in fact it doesn't) that we need a rescaling
if ( bw != m_pixmapWidth || bh != m_pixmapHeight )
m_pixmap = new QPixmap( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) );
m_pixmap = new QPixmap( img->scaled( m_pixmapWidth, m_pixmapHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
else
m_pixmap = new QPixmap( *img );
}
@ -299,7 +299,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
link = new KPDFLinkAction( KPDFLinkAction::Close );
}
else
kdDebug() << "Unknown named action: '" << name << "'" << endl;
kDebug() << "Unknown named action: '" << name << "'" << endl;
}
break;
@ -320,7 +320,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
*/ break;
case actionUnknown:
kdDebug() << "Unknown link." << endl;
kDebug() << "Unknown link." << endl;
break;
}

@ -31,7 +31,6 @@
#include <qpushbutton.h>
#include <dcopobject.h>
#include <dcopclient.h>
#include <kapplication.h>
#include <k3listviewsearchline.h>
#include <kaction.h>
#include <kdirwatch.h>
@ -167,7 +166,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
// thumbsBox->setStretchFactor( m_tc, 1 );
tbIndex = m_toolBox->addItem( thumbsBox, QIconSet(SmallIcon("thumbnail")), i18n("Thumbnails") );
m_toolBox->setItemToolTip( tbIndex, i18n("Thumbnails") );
m_toolBox->setCurrentItem( thumbsBox );
m_toolBox->setCurrentIndex( m_toolBox->indexOf( thumbsBox ) );
// [left toolbox: Reviews] | []
#warning this is making it crash
@ -215,7 +214,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
m_gotoPage = KStdAction::gotoPage( this, SLOT( slotGoToPage() ), ac, "goto_page" );
m_gotoPage->setShortcut( "CTRL+G" );
// dirty way to activate gotopage when pressing miniBar's button
connect( m_miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( activate() ) );
connect( m_miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( trigger() ) );
m_prevPage = KStdAction::prior(this, SLOT(slotPreviousPage()), ac, "previous_page");
m_prevPage->setWhatsThis( i18n( "Moves to the previous page of the document" ) );
@ -590,7 +589,7 @@ bool Part::closeURL()
void Part::close()
{
if (parent() && strcmp(parent()->name(), "KPDF::Shell") == 0)
if (parent() && (parent()->objectName() == QLatin1String("oKular::Shell")))
{
closeURL();
}
@ -705,10 +704,10 @@ void Part::enableTOC(bool enable)
}
//BEGIN go to page dialog
class KPDFGotoPageDialog : public KDialogBase
class KPDFGotoPageDialog : public KDialog
{
public:
KPDFGotoPageDialog(QWidget *p, int current, int max) : KDialogBase(p, 0L, true, i18n("Go to Page"), Ok | Cancel, Ok) {
KPDFGotoPageDialog(QWidget *p, int current, int max) : KDialog(p, i18n("Go to Page"), Ok | Cancel) {
QWidget *w = new QWidget(this);
setMainWidget(w);

@ -29,6 +29,7 @@
#include <qpushbutton.h>
#include <qapplication.h>
#include <qclipboard.h>
#include <QX11Info>
#include <dcopclient.h>
#include <kiconloader.h>
#include <kaction.h>
@ -623,7 +624,7 @@ if ( d->document->handleEvent( pe ) )
// blend selBlendColor into the background pixmap
// QImage blendedImage = blendedPixmap.convertToImage();
// KImageEffect::blend( selBlendColor.dark(140), blendedImage, 0.2 );
XRenderFillRectangle(x11Display(), PictOpOver, blendedPixmap.handle(), &col,
XRenderFillRectangle(x11Info().display(), PictOpOver, blendedPixmap.handle(), &col,
0,0, blendRect.width(), blendRect.height());
// copy the blended pixmap back to its place
pixmapPainter.drawPixmap( blendRect.left(), blendRect.top(), blendedPixmap );
@ -656,7 +657,7 @@ if ( d->document->handleEvent( pe ) )
blendRect.width(), blendRect.height() );
// blend selBlendColor into the background pixmap
// QImage blendedImage = blendedPixmap.convertToImage();
XRenderFillRectangle(x11Display(), PictOpOver, blendedPixmap.handle(), &col,
XRenderFillRectangle(x11Info().display(), PictOpOver, blendedPixmap.handle(), &col,
0,0, blendRect.width(), blendRect.height());
// KImageEffect::blend( d->mouseTextSelectionColor.dark(140), blendedImage, 0.2 );
@ -2126,7 +2127,7 @@ void PageView::slotRelayoutPages()
d->dirtyLayout = false;
// 4) update scrollview's contents size and recenter view
bool wasUpdatesEnabled = viewport()->isUpdatesEnabled();
bool wasUpdatesEnabled = viewport()->updatesEnabled();
if ( fullWidth != contentsWidth() || fullHeight != contentsHeight() )
{
// disable updates and resize the viewportContents

@ -243,9 +243,9 @@ ToolBarButton::ToolBarButton( QWidget * parent, const ToolBarItem & item, const
: QPushButton( parent ), m_id( item.id ), m_hovering( false ), m_background( pix )
{
setMouseTracking( true );
setToggleButton( true );
setCheckable( true );
resize( buttonSize, buttonSize );
setPixmap( DesktopIcon( item.pixmap, iconSize ) );
setIcon( DesktopIconSet( item.pixmap, iconSize ) );
setWindowFlags( Qt::WNoAutoErase );
// set shortcut if defined
if ( !item.shortcut.isEmpty() )

@ -651,7 +651,7 @@ void PresentationWidget::generateOverlay()
// end drawing pixmap and halve image
pixmapPainter.end();
QImage image( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) );
QImage image( doublePixmap.convertToImage().scaled( side / 2, side / 2, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
image.setAlphaBuffer( true );
// draw circular shadow using the same technique
@ -662,7 +662,7 @@ void PresentationWidget::generateOverlay()
// pixmapPainter.setBrush( 0x80 );
pixmapPainter.drawEllipse( 0, 0, side, side );
pixmapPainter.end();
QImage shadow( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) );
QImage shadow( doublePixmap.convertToImage().scaled( side / 2, side / 2, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
// generate a 2 colors pixmap using mixing shadow (made with highlight color)
// and image (made with highlightedText color)

@ -44,14 +44,15 @@ SearchWidget::SearchWidget( QWidget * parent, KPDFDocument * document )
addWidget(m_lineEdit);
// 2. clear button (uses a lineEdit slot, so it must be created after)
QAction *clearAction = addAction( KIcon(QApplication::reverseLayout() ? "clear_left" : "locationbar_erase"),
QAction *clearAction = addAction( KIcon(layoutDirection() ==
Qt::RightToLeft ? "clear_left" : "locationbar_erase"),
QString::null, m_lineEdit, SLOT( clear() ));
clearAction->setToolTip(i18n( "Clear filter" ));
// 3.1. create the popup menu for changing filtering features
m_menu = new QMenu( this );
m_caseSensitiveAction = m_menu->addAction( i18n("Case Sensitive") );
m_menu->insertSeparator( );
m_menu->addSeparator();
m_matchPhraseAction = m_menu->addAction( i18n("Match Phrase") );
m_marchAllWordsAction = m_menu->addAction( i18n("Match All Words") );
m_marchAnyWordsAction = m_menu->addAction( i18n("Match Any Word") );

@ -17,7 +17,7 @@
#include <kaction.h>
#include <kactionclasses.h>
#include <klocale.h>
#include <kapplication.h>
#include <qapplication.h>
#include <kiconloader.h>
// local includes
@ -47,7 +47,8 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document )
m_toolBar1->setIconDimensions( 16 );
m_toolBar1->setMovable( false );
// - add Clear button
QString clearIconName = KApplication::reverseLayout() ? "clear_left" : "locationbar_erase";
QString clearIconName = QApplication::layoutDirection() ==
Qt::RightToLeft ? "clear_left" : "locationbar_erase";
#warning lots of KToolBar code to port
/* m_toolBar1->insertButton( clearIconName, 1, SIGNAL( clicked() ),
m_searchLine, SLOT( clear() ), true, i18n( "Clear Filter" ) );

Loading…
Cancel
Save