]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/LTKOutputDev.cc
don't initialize embeddable (where did that come from?)
[evince.git] / pdf / xpdf / LTKOutputDev.cc
1 //========================================================================
2 //
3 // LTKOutputDev.cc
4 //
5 // Copyright 1998-2002 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifdef __GNUC__
10 #pragma implementation
11 #endif
12
13 #include <aconf.h>
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <stddef.h>
17 #include <string.h>
18 #include "gmem.h"
19 #include "GString.h"
20 #include "LTKWindow.h"
21 #include "LTKScrollingCanvas.h"
22 #include "Object.h"
23 #include "Stream.h"
24 #include "GfxState.h"
25 #include "GfxFont.h"
26 #include "Error.h"
27 #include "LTKOutputDev.h"
28
29 //------------------------------------------------------------------------
30
31 LTKOutputDev::LTKOutputDev(LTKWindow *winA, GBool reverseVideoA,
32                            unsigned long paperColor, GBool installCmap,
33                            GBool rgbCubeSize, GBool incrementalUpdateA):
34   XOutputDev(winA->getDisplay(),
35              ((LTKScrollingCanvas *)winA->findWidget("canvas"))->getPixmap(),
36              0, winA->getColormap(), reverseVideoA, paperColor,
37              installCmap, rgbCubeSize)
38 {
39   win = winA;
40   canvas = (LTKScrollingCanvas *)win->findWidget("canvas");
41   setPixmap(canvas->getPixmap(),
42             canvas->getRealWidth(), canvas->getRealHeight());
43   incrementalUpdate = incrementalUpdateA;
44 }
45
46 LTKOutputDev::~LTKOutputDev() {
47 }
48
49 void LTKOutputDev::startPage(int pageNum, GfxState *state) {
50   canvas->resize((int)(state->getPageWidth() + 0.5),
51                  (int)(state->getPageHeight() + 0.5));
52   setPixmap(canvas->getPixmap(),
53             canvas->getRealWidth(), canvas->getRealHeight());
54   XOutputDev::startPage(pageNum, state);
55   if (incrementalUpdate) {
56     canvas->redraw();
57   }
58 }
59
60 void LTKOutputDev::endPage() {
61   if (!incrementalUpdate) {
62     canvas->redraw();
63   }
64   XOutputDev::endPage();
65 }
66
67 void LTKOutputDev::dump() {
68   if (incrementalUpdate) {
69     canvas->redraw();
70   }
71   XOutputDev::dump();
72 }