From 562f3fb2ae4229961a2dd4f64d4a5928b85e281a Mon Sep 17 00:00:00 2001 From: Stefan Kebekus Date: Sat, 30 Apr 2005 08:51:52 +0000 Subject: [PATCH] changes due to API update svn path=/trunk/kdegraphics/kdvi/; revision=408763 --- dviWidget.cpp | 8 ++-- dviWidget.h | 4 +- dviwin.cpp | 20 ++++---- dviwin.h | 14 +++--- dviwin_draw.cpp | 81 ++++++++++++++++----------------- dviwin_prescan.cpp | 12 +++-- kdvi_multipage.cpp | 11 +++-- kdvi_multipage_texthandling.cpp | 11 +++-- psgs.cpp | 13 ++++-- psgs.h | 2 +- 10 files changed, 95 insertions(+), 81 deletions(-) diff --git a/dviWidget.cpp b/dviWidget.cpp index 2329cf08d..bb9aed55f 100644 --- a/dviWidget.cpp +++ b/dviWidget.cpp @@ -14,12 +14,12 @@ #include "dviWidget.h" #include "centeringScrollview.h" -#include "documentPagePixmap.h" #include "documentPageCache.h" #include "documentWidget.h" +#include "renderedDocumentPagePixmap.h" #include "selection.h" -DVIWidget::DVIWidget(QWidget* parent, CenteringScrollview* sv, QSize size, documentPageCache* cache, +DVIWidget::DVIWidget(QWidget* parent, CenteringScrollview* sv, QSize size, DocumentPageCache* cache, const char* name) : documentWidget(parent, sv, size, cache, name) { @@ -36,7 +36,7 @@ void DVIWidget::mousePressEvent(QMouseEvent* e) return; // Get a pointer to the page contents - documentPage* pageData = documentCache->getPage(pageNr); + RenderedDocumentPage* pageData = documentCache->getPage(pageNr); if (pageData == 0) { kdDebug(4300) << "DVIWidget::mousePressEvent(...) pageData for page #" << pageNr << " is empty" << endl; @@ -71,7 +71,7 @@ void DVIWidget::mouseMoveEvent(QMouseEvent* e) // Analyze the mouse movement only if no mouse button was pressed if ( e->state() == 0 ) { // Get a pointer to the page contents - documentPage* pageData = documentCache->getPage(pageNr); + RenderedDocumentPage* pageData = documentCache->getPage(pageNr); if (pageData == 0) { kdDebug(4300) << "DVIWidget::mouseMoveEvent(...) pageData for page #" << pageNr << " is empty" << endl; return; diff --git a/dviWidget.h b/dviWidget.h index 1c80245a3..0e4c5d7c2 100644 --- a/dviWidget.h +++ b/dviWidget.h @@ -14,7 +14,7 @@ #include "documentWidget.h" class CenteringScrollview; -class documentPageCache; +class DocumentPageCache; class QPaintEvent; class QMouseEvent; class textSelection; @@ -25,7 +25,7 @@ class DVIWidget : public documentWidget public: DVIWidget(QWidget* parent, CenteringScrollview* sv, QSize size, - documentPageCache* cache, const char* name); + DocumentPageCache* cache, const char* name); signals: void SRCLink(const QString&, QMouseEvent* e, documentWidget*); diff --git a/dviwin.cpp b/dviwin.cpp index c7f67eb5e..99828d298 100644 --- a/dviwin.cpp +++ b/dviwin.cpp @@ -53,13 +53,13 @@ //#define DEBUG_DVIWIN -QPainter foreGroundPaint; // QPainter used for text +QPainter *foreGroundPaint; // QPainter used for text //------ now comes the dviRenderer class implementation ---------- dviRenderer::dviRenderer(QWidget *par) - : documentRenderer(par), info(new infoDialog(par)) + : DocumentRenderer(par), info(new infoDialog(par)) { #ifdef DEBUG_DVIWIN kdDebug(4300) << "dviRenderer( parent=" << par << " )" << endl; @@ -139,7 +139,7 @@ void dviRenderer::showInfo(void) //------ this function calls the dvi interpreter ---------- -void dviRenderer::drawPage(double resolution, documentPage *page) +void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page) { #ifdef DEBUG_DVIWIN kdDebug(4300) << "dviRenderer::drawPage(documentPage *) called, page number " << page->getPageNumber() << endl; @@ -187,11 +187,13 @@ void dviRenderer::drawPage(double resolution, documentPage *page) colorStack.clear(); globalColor = Qt::black; - foreGroundPaint.begin( page->getPaintDevice() ); QApplication::setOverrideCursor( waitCursor ); - errorMsg = QString::null; - draw_page(); - foreGroundPaint.end(); + foreGroundPaint = page->getPainter(); + if (foreGroundPaint != 0) { + errorMsg = QString::null; + draw_page(); + delete foreGroundPaint; + } QApplication::restoreOverrideCursor(); page->isEmpty = false; if (errorMsg.isEmpty() != true) { @@ -578,7 +580,7 @@ Anchor dviRenderer::parseReference(const QString &reference) page = dviFile->total_pages; mutex.unlock(); - return Anchor(page, 0.0); + return Anchor(page, Length() ); } // case 2: The reference is of form "src:1111Filename", where "1111" @@ -633,7 +635,7 @@ Anchor dviRenderer::parseReference(const QString &reference) if (bestMatch != sourceHyperLinkAnchors.end()) { mutex.unlock(); - return Anchor(bestMatch->page, bestMatch->distance_from_top_in_inch); + return Anchor(bestMatch->page, bestMatch->distance_from_top); } else if (anchorForRefFileFound == false) KMessageBox::sorry(parentWidget, i18n("KDVI was not able to locate the place in the DVI file which corresponds to " diff --git a/dviwin.h b/dviwin.h index 6b5078c53..bf9c39a04 100644 --- a/dviwin.h +++ b/dviwin.h @@ -22,13 +22,13 @@ #include "anchor.h" #include "bigEndianByteReader.h" -#include "documentPage.h" #include "documentRenderer.h" #include "dviFile.h" #include "fontpool.h" #include "infodialog.h" #include "pageSize.h" #include "psgs.h" +#include "renderedDocumentPage.h" class documentWidget; @@ -48,13 +48,13 @@ extern const int MFResolutions[]; class DVI_SourceFileAnchor { public: DVI_SourceFileAnchor() {} - DVI_SourceFileAnchor(QString &name, Q_UINT32 ln, Q_UINT32 pg, double _distance_from_top_in_inch): fileName(name), line(ln), page(pg), - distance_from_top_in_inch(_distance_from_top_in_inch) {} + DVI_SourceFileAnchor(QString &name, Q_UINT32 ln, Q_UINT32 pg, Length _distance_from_top): fileName(name), line(ln), page(pg), + distance_from_top(_distance_from_top) {} QString fileName; Q_UINT32 line; Q_UINT32 page; - double distance_from_top_in_inch; + Length distance_from_top; }; /** Compound of registers, as defined in section 2.6.2 of the DVI @@ -88,7 +88,7 @@ struct drawinf { -class dviRenderer : public documentRenderer, bigEndianByteReader +class dviRenderer : public DocumentRenderer, bigEndianByteReader { Q_OBJECT @@ -148,7 +148,7 @@ public slots: - void drawPage(double res, documentPage *page); + void drawPage(double res, RenderedDocumentPage *page); /** Slots used in conjunction with external programs */ void dvips_output_receiver(KProcess *, char *buffer, int buflen); @@ -274,7 +274,7 @@ private: Q_UINT16 number_of_elements_in_path; struct drawinf currinf; - documentPage* currentlyDrawnPage; + RenderedDocumentPage* currentlyDrawnPage; }; diff --git a/dviwin_draw.cpp b/dviwin_draw.cpp index 85ab9bfde..6bd876a0e 100644 --- a/dviwin_draw.cpp +++ b/dviwin_draw.cpp @@ -66,10 +66,10 @@ #include #include #include -#include +#include #include -extern QPainter foreGroundPaint; +extern QPainter *foreGroundPaint; /** Routine to print characters. */ @@ -95,7 +95,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch) int y = currinf.data.pxl_v - g->y2; // Draw the character. - foreGroundPaint.drawPixmap(x, y, pix); + foreGroundPaint->drawPixmap(x, y, pix); // Are we drawing text for a hyperlink? And are hyperlinks // enabled? @@ -137,51 +137,50 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch) } // Code for DVI -> text functions (e.g. marking of text, full text - // search, etc.). Set up the currentlyDrawnPage->textLinkList. - Hyperlink link; - link.baseline = currinf.data.pxl_v; + // search, etc.). Set up the currentlyDrawnPage->textBoxList. + TextBox link; link.box.setRect(x, y, pix.width(), pix.height()); - link.linkText = ""; - currentlyDrawnPage->textLinkList.push_back(link); + link.text = ""; + currentlyDrawnPage->textBoxList.push_back(link); switch(ch) { case 0x0b: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "ff"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "ff"; break; case 0x0c: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "fi"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "fi"; break; case 0x0d: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "fl"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "fl"; break; case 0x0e: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "ffi"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "ffi"; break; case 0x0f: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "ffl"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "ffl"; break; case 0x7b: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "-"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "-"; break; case 0x7c: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "---"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "---"; break; case 0x7d: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "\""; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "\""; break; case 0x7e: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "~"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "~"; break; case 0x7f: - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "@@"; // @@@ check! + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "@@"; // @@@ check! break; default: if ((ch >= 0x21) && (ch <= 0x7a)) - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += QChar(ch); + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += QChar(ch); else - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += "?"; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "?"; break; } @@ -310,10 +309,10 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) int w = ((int) ROUNDUP(b, shrinkfactor * 65536)); if (colorStack.isEmpty()) - foreGroundPaint.fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), - currinf.data.pxl_v - h + 1, w?w:1, h?h:1, globalColor ); + foreGroundPaint->fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), + currinf.data.pxl_v - h + 1, w?w:1, h?h:1, globalColor ); else - foreGroundPaint.fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), + foreGroundPaint->fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), currinf.data.pxl_v - h + 1, w?w:1, h?h:1, colorStack.top() ); } currinf.data.dvi_h += b; @@ -332,10 +331,10 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) int h = ((int) ROUNDUP(a, shrinkfactor * 65536)); int w = ((int) ROUNDUP(b, shrinkfactor * 65536)); if (colorStack.isEmpty()) - foreGroundPaint.fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), - currinf.data.pxl_v - h + 1, w?w:1, h?h:1, globalColor ); + foreGroundPaint->fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), + currinf.data.pxl_v - h + 1, w?w:1, h?h:1, globalColor ); else - foreGroundPaint.fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), + foreGroundPaint->fillRect( ((int) ((currinf.data.dvi_h) / (shrinkfactor * 65536))), currinf.data.pxl_v - h + 1, w?w:1, h?h:1, colorStack.top() ); } break; @@ -403,8 +402,8 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) if ((is_vfmacro == false) && (currinf.fontp != 0) && ((RRtmp >= currinf.fontp->scaled_size_in_DVI_units/6) || (RRtmp <= -4*(currinf.fontp->scaled_size_in_DVI_units/6))) && - (currentlyDrawnPage->textLinkList.size() > 0)) - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += ' '; + (currentlyDrawnPage->textBoxList.size() > 0)) + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += ' '; currinf.data.dvi_h += ((long) (RRtmp * current_dimconv)); break; @@ -418,8 +417,8 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) if ((is_vfmacro == false) && (currinf.fontp != 0) && ((WWtmp >= currinf.fontp->scaled_size_in_DVI_units/6) || (WWtmp <= -4*(currinf.fontp->scaled_size_in_DVI_units/6))) && - (currentlyDrawnPage->textLinkList.size() > 0) ) - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += ' '; + (currentlyDrawnPage->textBoxList.size() > 0) ) + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += ' '; currinf.data.dvi_h += currinf.data.w; break; @@ -433,8 +432,8 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) if ((is_vfmacro == false) && (currinf.fontp != 0) && ((XXtmp >= currinf.fontp->scaled_size_in_DVI_units/6) || (XXtmp <= -4*(currinf.fontp->scaled_size_in_DVI_units/6))) && - (currentlyDrawnPage->textLinkList.size() > 0)) - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += ' '; + (currentlyDrawnPage->textBoxList.size() > 0)) + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += ' '; currinf.data.dvi_h += currinf.data.x; break; @@ -447,11 +446,11 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) if ((is_vfmacro == false) && (currinf.fontp != 0) && (abs(DDtmp) >= 5*(currinf.fontp->scaled_size_in_DVI_units/6)) && - (currentlyDrawnPage->textLinkList.size() > 0)) { + (currentlyDrawnPage->textBoxList.size() > 0)) { word_boundary_encountered = true; line_boundary_encountered = true; if (abs(DDtmp) >= 10*(currinf.fontp->scaled_size_in_DVI_units/6)) - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += '\n'; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += '\n'; } currinf.data.dvi_v += ((long) (DDtmp * current_dimconv))/65536; currinf.data.pxl_v = int(currinf.data.dvi_v/shrinkfactor); @@ -468,11 +467,11 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) if ((is_vfmacro == false) && (currinf.fontp != 0) && (abs(YYtmp) >= 5*(currinf.fontp->scaled_size_in_DVI_units/6)) && - (currentlyDrawnPage->textLinkList.size() > 0)) { + (currentlyDrawnPage->textBoxList.size() > 0)) { word_boundary_encountered = true; line_boundary_encountered = true; if (abs(YYtmp) >= 10*(currinf.fontp->scaled_size_in_DVI_units/6)) - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += '\n'; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += '\n'; } currinf.data.dvi_v += currinf.data.y/65536; currinf.data.pxl_v = int(currinf.data.dvi_v/shrinkfactor); @@ -488,11 +487,11 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) if ((is_vfmacro == false) && (currinf.fontp != 0) && (abs(ZZtmp) >= 5*(currinf.fontp->scaled_size_in_DVI_units/6)) && - (currentlyDrawnPage->textLinkList.size() > 0)) { + (currentlyDrawnPage->textBoxList.size() > 0)) { word_boundary_encountered = true; line_boundary_encountered = true; if (abs(ZZtmp) >= 10*(currinf.fontp->scaled_size_in_DVI_units/6)) - currentlyDrawnPage->textLinkList[currentlyDrawnPage->textLinkList.size()-1].linkText += '\n'; + currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += '\n'; } currinf.data.dvi_v += currinf.data.z/65536; currinf.data.pxl_v = int(currinf.data.dvi_v/shrinkfactor); @@ -573,7 +572,7 @@ void dviRenderer::draw_page(void) // Calling resize() here rather than clear() means that the memory // taken up by the vector is not freed. This is faster than // constantly allocating/freeing memory. - currentlyDrawnPage->textLinkList.resize(0); + currentlyDrawnPage->textBoxList.resize(0); currentlyDrawnPage->sourceHyperLinkList.resize(0); #ifdef PERFORMANCE_MEASUREMENT @@ -593,12 +592,12 @@ void dviRenderer::draw_page(void) if (!accessibilityBackground) { - foreGroundPaint.fillRect( foreGroundPaint.viewport(), PS_interface->getBackgroundColor(current_page) ); + foreGroundPaint->fillRect( foreGroundPaint->viewport(), PS_interface->getBackgroundColor(current_page) ); } else { // In accessiblity mode use the custom background color - foreGroundPaint.fillRect( foreGroundPaint.viewport(), accessibilityBackgroundColor ); + foreGroundPaint->fillRect( foreGroundPaint->viewport(), accessibilityBackgroundColor ); } // Render the PostScript background, if there is one. diff --git a/dviwin_prescan.cpp b/dviwin_prescan.cpp index d070eb7a0..9011cc461 100644 --- a/dviwin_prescan.cpp +++ b/dviwin_prescan.cpp @@ -261,7 +261,9 @@ void dviRenderer::prescan_ParseBackgroundSpecial(QString cp) void dviRenderer::prescan_ParseHTMLAnchorSpecial(QString cp) { cp.truncate(cp.find('"')); - anchorList[cp] = Anchor(current_page+1, currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); + Length l; + l.setLength_in_inch(currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); + anchorList[cp] = Anchor(current_page+1, l); } @@ -333,7 +335,9 @@ void dviRenderer::prescan_ParsePSSpecial(QString cp) if (cp.startsWith("ps:SDict begin [") && cp.endsWith(" pdfmark end")) { // hyperref definition of link/anchor/bookmark/etc if (cp.contains("/DEST")) { // The PostScript code defines an anchor QString anchorName = cp.section('(', 1, 1).section(')', 0, 0); - anchorList[anchorName] = Anchor(current_page+1, currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); + Length l; + l.setLength_in_inch(currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); + anchorList[anchorName] = Anchor(current_page+1, l); } return; } @@ -462,7 +466,9 @@ void dviRenderer::prescan_ParseSourceSpecial(QString cp) Q_UINT32 sourceLineNumber = cp.left(j).toUInt(); QFileInfo fi1(dviFile->filename); QString sourceFileName = QFileInfo(fi1.dir(), cp.mid(j).stripWhiteSpace()).absFilePath(); - DVI_SourceFileAnchor sfa(sourceFileName, sourceLineNumber, current_page+1, currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); + Length l; + l.setLength_in_inch(currinf.data.dvi_v/(resolutionInDPI*shrinkfactor)); + DVI_SourceFileAnchor sfa(sourceFileName, sourceLineNumber, current_page+1, l); sourceHyperLinkAnchors.push_back(sfa); } diff --git a/kdvi_multipage.cpp b/kdvi_multipage.cpp index 1a71513a9..288995d65 100644 --- a/kdvi_multipage.cpp +++ b/kdvi_multipage.cpp @@ -19,18 +19,19 @@ #include "../config.h" #include "../kviewshell/marklist.h" -#include "documentPagePixmap.h" #include "documentWidget.h" +#include "dviWidget.h" #include "fontpool.h" #include "kdvi_multipage.h" +#include "kprinterwrapper.h" #include "kviewpart.h" +#include "optionDialogFontsWidget.h" +#include "optionDialogSpecialWidget.h" #include "performanceMeasurement.h" #include "prefs.h" -#include "kprinterwrapper.h" -#include "dviWidget.h" +#include "renderedDocumentPagePixmap.h" + -#include "optionDialogFontsWidget.h" -#include "optionDialogSpecialWidget.h" #include diff --git a/kdvi_multipage_texthandling.cpp b/kdvi_multipage_texthandling.cpp index 62098e89f..930f3f0e8 100644 --- a/kdvi_multipage_texthandling.cpp +++ b/kdvi_multipage_texthandling.cpp @@ -2,7 +2,7 @@ // Class: kdvi_multipage // Author: Stefan Kebekus // -// (C) 2001-2004, Stefan Kebekus. +// (C) 2001-2005, Stefan Kebekus. // // Previewer for TeX DVI files. // @@ -34,9 +34,10 @@ #include #include -#include "documentPagePixmap.h" #include "documentWidget.h" #include "kdvi_multipage.h" +#include "renderedDocumentPagePixmap.h" + //#define KDVI_MULTIPAGE_DEBUG @@ -85,7 +86,7 @@ void KDVIMultiPage::doExportText(void) QProgressDialog progress( i18n("Exporting to text..."), i18n("Abort"), DVIRenderer.totalPages(), scrollView(), "export_text_progress", TRUE ); progress.setMinimumDuration(300); - documentPagePixmap dummyPage; + RenderedDocumentPagePixmap dummyPage; dummyPage.resize(1,1); for(int page=1; page <= DVIRenderer.totalPages(); page++) { @@ -105,8 +106,8 @@ void KDVIMultiPage::doExportText(void) dummyPage.setPageNumber(page); DVIRenderer.drawPage(100.0, &dummyPage); // We gracefully ingore any errors (bad dvi-file, etc.) which may occur during draw_page() - for(unsigned int i=0; iviewport().width(); + pixel_page_h = paint->viewport().height(); pageInfo *info = pageList.find(page); @@ -295,7 +300,7 @@ void ghostscript_interface::graphics(PageNumber page, double dpi, long magnifica gs_generate_graphics_file(page, GfxFile->name(), magnification); QPixmap MemoryCopy(GfxFile->name()); - paint.drawPixmap(0, 0, MemoryCopy); + paint->drawPixmap(0, 0, MemoryCopy); return; } diff --git a/psgs.h b/psgs.h index 4c218090e..9c41e1a8e 100644 --- a/psgs.h +++ b/psgs.h @@ -59,7 +59,7 @@ public: // Draws the graphics of the page into the painter, if possible. If // the page does not contain any graphics, nothing happens - void graphics(PageNumber page, double dpi, long magnification, QPainter &paint ); + void graphics(PageNumber page, double dpi, long magnification, QPainter *paint ); // Returns the background color for a certain page. If no color was // set, Qt::white is returned.