-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCoreOutputDev.cc
63 lines (53 loc) · 1.62 KB
/
CoreOutputDev.cc
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
//========================================================================
//
// CoreOutputDev.cc
//
// Copyright 2004 Glyph & Cog, LLC
//
//========================================================================
#include <poppler-config.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#include "poppler/Object.h"
#include "poppler/TextOutputDev.h"
#include "CoreOutputDev.h"
#include "GlobalParamsGUI.h"
//------------------------------------------------------------------------
// CoreOutputDev
//------------------------------------------------------------------------
CoreOutputDev::CoreOutputDev(SplashColorMode colorModeA, int bitmapRowPadA,
bool reverseVideoA, SplashColorPtr paperColorA,
bool incrementalUpdateA,
CoreOutRedrawCbk redrawCbkA,
void *redrawCbkDataA):
SplashOutputDev(colorModeA, bitmapRowPadA, reverseVideoA, paperColorA),
incrementalUpdate(incrementalUpdateA), redrawCbk(redrawCbkA),
redrawCbkData(redrawCbkDataA)
{
setFreeTypeHinting(globalParamsGUI->getEnableFreeTypeHinting(),
globalParamsGUI->getEnableFreeTypeSlightHinting());
}
CoreOutputDev::~CoreOutputDev() {
}
void CoreOutputDev::endPage() {
SplashOutputDev::endPage();
if (!incrementalUpdate) {
(*redrawCbk)(redrawCbkData, 0, 0, getBitmapWidth(), getBitmapHeight(),
true);
}
}
void CoreOutputDev::dump() {
int x0, y0, x1, y1;
if (incrementalUpdate) {
getModRegion(&x0, &y0, &x1, &y1);
clearModRegion();
if (x1 >= x0 && y1 >= y0) {
(*redrawCbk)(redrawCbkData, x0, y0, x1, y1, false);
}
}
}
void CoreOutputDev::clear() {
startDoc(NULL);
startPage(0, NULL);
}