Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/LTKOutputDev.cc
blob: ba5a332bc48fd2fa794fabb167617034b0591abc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//========================================================================
//
// LTKOutputDev.cc
//
// Copyright 1998-2002 Glyph & Cog, LLC
//
//========================================================================

#ifdef __GNUC__
#pragma implementation
#endif

#include <aconf.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include "gmem.h"
#include "GString.h"
#include "LTKWindow.h"
#include "LTKScrollingCanvas.h"
#include "Object.h"
#include "Stream.h"
#include "GfxState.h"
#include "GfxFont.h"
#include "Error.h"
#include "LTKOutputDev.h"

//------------------------------------------------------------------------

LTKOutputDev::LTKOutputDev(LTKWindow *winA, GBool reverseVideoA,
			   unsigned long paperColor, GBool installCmap,
			   GBool rgbCubeSize, GBool incrementalUpdateA):
  XOutputDev(winA->getDisplay(),
	     ((LTKScrollingCanvas *)winA->findWidget("canvas"))->getPixmap(),
	     0, winA->getColormap(), reverseVideoA, paperColor,
	     installCmap, rgbCubeSize)
{
  win = winA;
  canvas = (LTKScrollingCanvas *)win->findWidget("canvas");
  setPixmap(canvas->getPixmap(),
	    canvas->getRealWidth(), canvas->getRealHeight());
  incrementalUpdate = incrementalUpdateA;
}

LTKOutputDev::~LTKOutputDev() {
}

void LTKOutputDev::startPage(int pageNum, GfxState *state) {
  canvas->resize((int)(state->getPageWidth() + 0.5),
		 (int)(state->getPageHeight() + 0.5));
  setPixmap(canvas->getPixmap(),
	    canvas->getRealWidth(), canvas->getRealHeight());
  XOutputDev::startPage(pageNum, state);
  if (incrementalUpdate) {
    canvas->redraw();
  }
}

void LTKOutputDev::endPage() {
  if (!incrementalUpdate) {
    canvas->redraw();
  }
  XOutputDev::endPage();
}

void LTKOutputDev::dump() {
  if (incrementalUpdate) {
    canvas->redraw();
  }
  XOutputDev::dump();
}