- add supported mimetype caching to the kpdf part properly

- begin work on ghostscript backend port to libqgs
- minor tweak in configure.in.bot 

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=486447
This commit is contained in:
Piotr Szymanski 2005-12-07 21:25:25 +00:00
parent 99c8344024
commit 5e0e973e12
5 changed files with 20 additions and 19 deletions

View file

@ -10,7 +10,8 @@ echo "or contact your package provider."
echo ""
fi
if test "$HAVE_CHMLIB" != "yes"; then
if test "x$HAVE_CHMLIB" != "xyes"; then
echo ""
echo "The chm library was not found in your system."
echo "The chm backend will not be available."

View file

@ -7,12 +7,12 @@
* (at your option) any later version. *
***************************************************************************/
#include "interpreter_lib.h"
#include "kpdflibgsasyncgenerator.h"
#include "gsapi/iapi.h"
#include "gsapi/gdevdsp.h"
#include <qgs.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qimage.h>
#include <kapplication.h>
@ -33,11 +33,14 @@ int anwser;
PageInfo pData;
FILE * f;
void PixHandler::slotPixmap(PixmapRequest *req)
void PixHandler::slotPixmap(const QImage* img)
{
QPixmap *pix=interpreter->takePixmap();
QPixmap *pix=new QPixmap(img->size(), img->depth());
kdDebug() << "Handles: " << pix->handle() << " " << pData.handle <<endl;
QPainter p;
p.begin(pix);
p.drawImage(0,0,*img, 0,0,img->width(),img->height());
p.end();
XCopyArea
(qt_xdisplay(),
pix->handle(),
@ -60,15 +63,10 @@ void process()
read ( mem, &pData, sizeof(pData) );
if ( !interpreter->running() )
interpreter->startInterpreter();
interpreter->start(false);
kdDebug() << "Processing: " << pData.sync << endl;
if (pData.sync)
{
kdDebug() << "Request: " << pData.req.width << " " << pData.req.height << endl;
}
interpreter-> run ( f, &pData.pos, (pData.sync ? &pData.req : static_cast<PixmapRequest*>(0L) ), pData.sync );
// kdDebug() << "Processing: " << pData.sync << endl;
interpreter-> run ( f, pData.pos, pData.sync );
if (! pData.sync )
{
int x=3;
@ -91,7 +89,8 @@ int main (int argc, char* argv[])
interpreter->setSize ( QString(argv[7]).toInt(), QString(argv[8]).toInt() );
KApplication app(argc,argv,QCString("kpdflibgsasyncgenerator"));
PixHandler pxHandler;
QObject::connect(interpreter,SIGNAL(newPageImage(PixmapRequest*)),&pxHandler,SLOT(slotPixmap(PixmapRequest *)));
QObject::connect(interpreter,SIGNAL(Finished(const QImage* img)),&pxHandler,SLOT(slotPixmap(const QImage* img)));
int request;
anwser = open( argv[3] , O_RDWR );

View file

@ -13,12 +13,12 @@
#include <qpixmap.h>
#include <interpreter.h>
#include <core/generator.h>
class QImage;
class PixHandler : public QObject
{
Q_OBJECT
public slots:
void slotPixmap(PixmapRequest *req);
void slotPixmap(const QImage* img);
};
struct PageInfo

View file

@ -337,7 +337,7 @@ void Part::supportedMimetypes()
for (; iterator != end; ++iterator)
{
KService::Ptr service = *iterator;
mimeTypes = service->serviceTypes();
QStringList mimeTypes = service->serviceTypes();
for (mimeType=mimeTypes.begin();mimeType!=mimeTypes.end();++mimeType)
if (! (*mimeType).contains("oKular"))
m_supportedMimeTypes << *mimeType;

1
part.h
View file

@ -89,6 +89,7 @@ protected:
bool closeURL();
// filter that watches for splitter size changes
bool eventFilter( QObject * watched, QEvent * e );
void supportedMimetypes();
protected slots:
// connected to actions