You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
/*************************************************************************** |
|
* Copyright (C) 2004 by Dominique Devriese <devriese@kde.org> * |
|
* Copyright (C) 2004 by Christophe Devriese * |
|
* <Christophe.Devriese@student.kuleuven.ac.be> * |
|
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> * |
|
* * |
|
* This program is free software; you can redistribute it and/or modify * |
|
* it under the terms of the GNU General Public License as published by * |
|
* the Free Software Foundation; either version 2 of the License, or * |
|
* (at your option) any later version. * |
|
***************************************************************************/ |
|
|
|
#include "SplashBitmap.h" |
|
#include "SplashTypes.h" |
|
|
|
#include "QOutputDevKPrinter.h" |
|
|
|
#include <kprinter.h> |
|
#include <qpainter.h> |
|
#include <qimage.h> |
|
|
|
QOutputDevKPrinter::QOutputDevKPrinter(QPainter& painter, SplashColor paperColor, KPrinter& printer ) |
|
: QOutputDev(paperColor), m_printer( printer ), m_painter( painter ) |
|
{ |
|
} |
|
|
|
QOutputDevKPrinter::~QOutputDevKPrinter() |
|
{ |
|
} |
|
|
|
void QOutputDevKPrinter::startPage(int page, GfxState *state) |
|
{ |
|
// TODO: page size ? |
|
QOutputDev::startPage( page, state); |
|
} |
|
|
|
void QOutputDevKPrinter::endPage() |
|
{ |
|
SplashColorPtr dataPtr; |
|
int bh, bw; |
|
|
|
QOutputDev::endPage(); |
|
bh = getBitmap()->getHeight(); |
|
bw = getBitmap()->getWidth(); |
|
dataPtr = getBitmap()->getDataPtr(); |
|
m_painter.drawPixmap(0, 0, QImage((uchar*)dataPtr.rgb8, bw, bh, 32, 0, 0, QImage::IgnoreEndian)); |
|
}
|
|
|