Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/Gfx.cc
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2003-03-31 21:08:43 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2003-03-31 21:08:43 (GMT)
commit64676031423465996e83c4a685290f0c3d97a249 (patch)
treecef578bc8c300722abb3fe1693181e68895a94a7 /pdf/xpdf/Gfx.cc
parent28c37dbcf87665a4ccec58bef9ef8ff0697022dd (diff)
kill traces of ltk, incorporate new sources
* xpdf/Makefile.am: kill traces of ltk, incorporate new sources * Makefile.am, configure.in: don't build the ltk subdir * ANNOUNCE, CHANGES, ChangeLog, README, aconf-dj.h, aconf-win32.h, dj_make.bat, ms_make.bat, vms_make.com: update * xpdf/LTKOutputDev.cc, xpdf/LTKOutputDev.h, xpdf/postscript.xbm, xpdf/xpdf-flip.ltk, xpdf/xpdf-ltk.h, xpdf/xpdf-top.ltk, xpdf/xpdf.ltk: remove. * xpdf/Annot.cc, xpdf/Annot.h, xpdf/Array.cc, xpdf/Array.h, xpdf/BuiltinFont.cc, xpdf/BuiltinFont.h, xpdf/BuiltinFontTables.cc, xpdf/CMap.cc, xpdf/CMap.h, xpdf/Catalog.cc, xpdf/Catalog.h, xpdf/CharCodeToUnicode.cc, xpdf/CharCodeToUnicode.h, xpdf/Decrypt.cc, xpdf/Decrypt.h, xpdf/Dict.cc, xpdf/Dict.h, xpdf/Error.cc, xpdf/Error.h, xpdf/FTFont.cc, xpdf/FTFont.h, xpdf/FontFile.cc, xpdf/FontFile.h, xpdf/Function.cc, xpdf/Function.h, xpdf/Gfx.cc, xpdf/Gfx.h, xpdf/GfxFont.cc, xpdf/GfxFont.h, xpdf/GfxState.cc, xpdf/GfxState.h, xpdf/GlobalParams.cc, xpdf/GlobalParams.h, xpdf/ImageOutputDev.cc, xpdf/ImageOutputDev.h, xpdf/Lexer.cc, xpdf/Lexer.h, xpdf/Link.cc, xpdf/Link.h, xpdf/NameToCharCode.cc, xpdf/NameToCharCode.h, xpdf/NameToUnicodeTable.h, xpdf/Object.cc, xpdf/Object.h, xpdf/OutputDev.cc, xpdf/OutputDev.h, xpdf/PBMOutputDev.cc, xpdf/PBMOutputDev.h, xpdf/PDFDoc.cc, xpdf/PDFDoc.h, xpdf/PSOutputDev.cc, xpdf/PSOutputDev.h, xpdf/PSTokenizer.cc, xpdf/PSTokenizer.h, xpdf/Page.cc, xpdf/Page.h, xpdf/Parser.cc, xpdf/Parser.h, xpdf/SFont.cc, xpdf/SFont.h, xpdf/Stream.cc, xpdf/Stream.h, xpdf/T1Font.cc, xpdf/T1Font.h, xpdf/TTFont.cc, xpdf/TTFont.h, xpdf/TextOutputDev.cc, xpdf/TextOutputDev.h, xpdf/UnicodeMap.cc, xpdf/UnicodeMap.h, xpdf/XOutputDev.cc, xpdf/XOutputDev.h, xpdf/XRef.cc, xpdf/XRef.h, xpdf/config.h, xpdf/pdffonts.cc, xpdf/pdfimages.cc, xpdf/pdfinfo.cc, xpdf/pdftopbm.cc, xpdf/pdftops.cc, xpdf/pdftotext.cc, xpdf/vms_make.com, xpdf/xpdf.cc: update. * goo/GHash.cc, goo/GHash.h, goo/GList.cc, goo/GList.h, goo/GString.cc, goo/GString.h: mostly Mac OS X gcc fixage. * doc/pdffonts.1, doc/pdffonts.cat, doc/pdffonts.hlp, doc/pdfimages.1, doc/pdfimages.cat, doc/pdfimages.hlp, doc/pdfinfo.1, doc/pdfinfo.cat, doc/pdfinfo.hlp, doc/pdftopbm.1, doc/pdftopbm.cat, doc/pdftopbm.hlp, doc/pdftops.1, doc/pdftops.cat, doc/pdftops.hlp, doc/pdftotext.1, doc/pdftotext.cat, doc/pdftotext.hlp, doc/xpdf.1, doc/xpdf.cat, doc/xpdf.hlp, doc/xpdfrc.5, doc/xpdfrc.cat, doc/xpdfrc.hlp: update docs.
Diffstat (limited to 'pdf/xpdf/Gfx.cc')
-rw-r--r--pdf/xpdf/Gfx.cc39
1 files changed, 29 insertions, 10 deletions
diff --git a/pdf/xpdf/Gfx.cc b/pdf/xpdf/Gfx.cc
index 0b00f91..2717a04 100644
--- a/pdf/xpdf/Gfx.cc
+++ b/pdf/xpdf/Gfx.cc
@@ -6,16 +6,18 @@
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
-#include <aconf.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <math.h>
#include "gmem.h"
+#include "GlobalParams.h"
#include "CharTypes.h"
#include "Object.h"
#include "Array.h"
@@ -381,12 +383,13 @@ GBool GfxResources::lookupGState(char *name, Object *obj) {
Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, double dpi,
PDFRectangle *box, GBool crop, PDFRectangle *cropBox, int rotate,
- GBool printCommandsA) {
+ GBool (*abortCheckCbkA)(void *data),
+ void *abortCheckCbkDataA) {
int i;
xref = xrefA;
subPage = gFalse;
- printCommands = printCommandsA;
+ printCommands = globalParams->getPrintCommands();
// start the resource stack
res = new GfxResources(xref, resDict, NULL);
@@ -403,6 +406,8 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, double dpi,
for (i = 0; i < 6; ++i) {
baseMatrix[i] = state->getCTM()[i];
}
+ abortCheckCbk = abortCheckCbkA;
+ abortCheckCbkData = abortCheckCbkDataA;
// set crop box
if (crop) {
@@ -418,12 +423,14 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, double dpi,
}
Gfx::Gfx(XRef *xrefA, OutputDev *outA, Dict *resDict,
- PDFRectangle *box, GBool crop, PDFRectangle *cropBox) {
+ PDFRectangle *box, GBool crop, PDFRectangle *cropBox,
+ GBool (*abortCheckCbkA)(void *data),
+ void *abortCheckCbkDataA) {
int i;
xref = xrefA;
subPage = gTrue;
- printCommands = gFalse;
+ printCommands = globalParams->getPrintCommands();
// start the resource stack
res = new GfxResources(xref, resDict, NULL);
@@ -437,6 +444,8 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, Dict *resDict,
for (i = 0; i < 6; ++i) {
baseMatrix[i] = state->getCTM()[i];
}
+ abortCheckCbk = abortCheckCbkA;
+ abortCheckCbkData = abortCheckCbkDataA;
// set crop box
if (crop) {
@@ -494,11 +503,11 @@ void Gfx::display(Object *obj, GBool topLevel) {
void Gfx::go(GBool topLevel) {
Object obj;
Object args[maxArgs];
- int numArgs;
- int i;
+ int numArgs, i;
+ int lastAbortCheck;
// scan a sequence of objects
- updateLevel = 0;
+ updateLevel = lastAbortCheck = 0;
numArgs = 0;
parser->getObj(&obj);
while (!obj.isEOF()) {
@@ -526,6 +535,16 @@ void Gfx::go(GBool topLevel) {
updateLevel = 0;
}
+ // check for an abort
+ if (abortCheckCbk) {
+ if (updateLevel - lastAbortCheck > 10) {
+ if ((*abortCheckCbk)(abortCheckCbkData)) {
+ break;
+ }
+ lastAbortCheck = updateLevel;
+ }
+ }
+
// got an argument - save it
} else if (numArgs < maxArgs) {
args[numArgs++] = obj;
@@ -575,7 +594,7 @@ void Gfx::execOp(Object *cmd, Object args[], int numArgs) {
int i;
// find operator
- name = cmd->getName();
+ name = cmd->getCmd();
if (!(op = findOp(name))) {
if (ignoreUndef == 0)
error(getPos(), "Unknown operator '%s'", name);