Commit 51670972 authored by Albert Astals Cid's avatar Albert Astals Cid

Last xpdf 3.01 merge (at least from my side)

It's very big, but noone has opposed in the 2 weeks time i gave on the ml so either poppler is dead or people agree with the patch
parent 10dfa225
2005-10-30 Albert Astals Cid <aacid@kde.org>
* glib/poppler-page.cc
* poppler/ArthurOutputDev.cc
* poppler/ArthurOutputDev.h
* poppler/CairoOutputDev.cc
* poppler/CairoOutputDev.h
* poppler/Gfx.cc
* poppler/Gfx.h
* poppler/GfxState.cc
* poppler/GfxState.h
* poppler/OutputDev.cc
* poppler/OutputDev.h
* poppler/PDFDoc.cc
* poppler/PDFDoc.h
* poppler/PSOutputDev.cc
* poppler/PSOutputDev.h
* poppler/Page.cc
* poppler/Page.h
* poppler/SplashOutputDev.cc
* poppler/SplashOutputDev.h
* poppler/TextOutputDev.cc
* poppler/TextOutputDev.h
* qt/poppler-page.cc
* qt4/src/poppler-page.cc
* splash/Splash.cc
* splash/Splash.h
* splash/SplashBitmap.cc
* splash/SplashBitmap.h
* splash/SplashPattern.cc
* splash/SplashPattern.h
* splash/SplashState.cc
* splash/SplashState.h
* splash/SplashTypes.h
* test/gtk-cairo-test.cc
* test/gtk-splash-test.cc
* test/pdf-inspector.cc: Last xpdf 3.01 merges
2005-10-16 Kristian Høgsberg <krh@redhat.com>
* poppler/poppler-config.h.in (GCC_PRINTF_FORMAT): Remove evil
......
......@@ -85,11 +85,11 @@ poppler_page_get_size (PopplerPage *page,
rotate = page->page->getRotate ();
if (rotate == 90 || rotate == 270) {
page_height = page->page->getWidth ();
page_width = page->page->getHeight ();
page_height = page->page->getCropWidth ();
page_width = page->page->getCropHeight ();
} else {
page_width = page->page->getWidth ();
page_height = page->page->getHeight ();
page_width = page->page->getCropWidth ();
page_height = page->page->getCropHeight ();
}
if (width != NULL)
......@@ -129,11 +129,11 @@ poppler_page_prepare_output_dev (PopplerPage *page,
rotate = (rotation + page->page->getRotate()) % 360;
if (rotate == 90 || rotate == 270) {
cairo_width = MAX ((int)(page->page->getHeight() * scale + 0.5), 1);
cairo_height = MAX ((int)(page->page->getWidth() * scale + 0.5), 1);
cairo_width = MAX ((int)(page->page->getCropHeight() * scale + 0.5), 1);
cairo_height = MAX ((int)(page->page->getCropWidth() * scale + 0.5), 1);
} else {
cairo_width = MAX ((int)(page->page->getWidth() * scale + 0.5), 1);
cairo_height = MAX ((int)(page->page->getHeight() * scale + 0.5), 1);
cairo_width = MAX ((int)(page->page->getCropWidth() * scale + 0.5), 1);
cairo_height = MAX ((int)(page->page->getCropHeight() * scale + 0.5), 1);
}
output_dev = page->document->output_dev;
......@@ -301,6 +301,7 @@ poppler_page_render_to_pixbuf (PopplerPage *page,
page->page->displaySlice(page->document->output_dev,
72.0 * scale, 72.0 * scale,
rotation,
gFalse, /* useMediaBox */
gTrue, /* Crop */
src_x, src_y,
src_width, src_height,
......@@ -318,6 +319,7 @@ poppler_page_get_text_output_dev (PopplerPage *page)
page->gfx = page->page->createGfx(page->text_dev,
72.0, 72.0, 0,
gFalse, /* useMediaBox */
gTrue, /* Crop */
-1, -1, -1, -1,
NULL, /* links */
......@@ -642,15 +644,17 @@ poppler_page_find_text (PopplerPage *page,
doc = page->document->doc;
poppler_page_get_size (page, NULL, &height);
page->page->display (output_dev, 72, 72, 0,
page->page->display (output_dev, 72, 72, 0, gFalse,
gTrue, NULL, doc->getCatalog());
matches = NULL;
xMin = 0;
yMin = 0;
#warning you probably want to add caseSensitive and backwards as parameters
while (output_dev->findText (ucs4, ucs4_len,
gFalse, gTrue, // startAtTop, stopAtBottom
gTrue, gFalse, // startAtLast, stopAtLast
gFalse, gFalse, // caseSensitive, backwards
&xMin, &yMin, &xMax, &yMax))
{
match = g_new (PopplerRectangle, 1);
......@@ -693,7 +697,7 @@ poppler_page_render_to_ps (PopplerPage *page,
ps_file->document->doc->displayPage (ps_file->out, page->index + 1, 72.0, 72.0,
0, gTrue, gFalse);
0, gFalse, gTrue, gFalse);
}
static void
......@@ -780,10 +784,10 @@ poppler_page_get_link_mapping (PopplerPage *page)
link->getRect (&(mapping->area.x1), &(mapping->area.y1),
&(mapping->area.x2), &(mapping->area.y2));
mapping->area.x1 -= page->page->getBox()->x1;
mapping->area.x2 -= page->page->getBox()->x1;
mapping->area.y1 -= page->page->getBox()->y1;
mapping->area.y2 -= page->page->getBox()->y1;
mapping->area.x1 -= page->page->getCropBox()->x1;
mapping->area.x2 -= page->page->getCropBox()->x1;
mapping->area.y1 -= page->page->getCropBox()->y1;
mapping->area.y2 -= page->page->getCropBox()->y1;
map_list = g_list_prepend (map_list, mapping);
}
......
......@@ -485,7 +485,7 @@ void ArthurOutputDev::eoClip(GfxState *state)
void ArthurOutputDev::drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode code, Unicode *u, int uLen) {
CharCode code, int nBytes, Unicode *u, int uLen) {
double x1, y1;
// SplashPath *path;
int render;
......
......@@ -102,7 +102,7 @@ public:
virtual void drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode code, Unicode *u, int uLen);
CharCode code, int nBytes, Unicode *u, int uLen);
virtual GBool beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
CharCode code, Unicode *u, int uLen);
......
......@@ -348,7 +348,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s)
void CairoOutputDev::drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode code, Unicode *u, int uLen)
CharCode code, int nBytes, Unicode *u, int uLen)
{
double tx, ty;
......
......@@ -102,7 +102,7 @@ public:
void drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode code, Unicode *u, int uLen);
CharCode code, int nBytes, Unicode *u, int uLen);
virtual GBool beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
......
This diff is collapsed.
......@@ -32,6 +32,9 @@ class GfxShading;
class GfxFunctionShading;
class GfxAxialShading;
class GfxRadialShading;
class GfxGouraudTriangleShading;
class GfxPatchMeshShading;
struct GfxPatch;
class GfxState;
struct GfxColor;
class Gfx;
......@@ -100,14 +103,14 @@ public:
// Constructor for regular output.
Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict,
double hDPI, double vDPI, PDFRectangle *box, GBool crop,
double hDPI, double vDPI, PDFRectangle *box,
PDFRectangle *cropBox, int rotate,
GBool (*abortCheckCbkA)(void *data) = NULL,
void *abortCheckCbkDataA = NULL);
// Constructor for a sub-page object.
Gfx(XRef *xrefA, OutputDev *outA, Dict *resDict,
PDFRectangle *box, GBool crop, PDFRectangle *cropBox,
PDFRectangle *box, PDFRectangle *cropBox,
GBool (*abortCheckCbkA)(void *data) = NULL,
void *abortCheckCbkDataA = NULL);
......@@ -127,6 +130,9 @@ public:
// Restore graphics state.
void restoreState();
// Get the current graphics state object.
GfxState *getState() { return state; }
private:
XRef *xref; // the xref table for this PDF file
......@@ -216,6 +222,13 @@ private:
GfxColor *colors, int depth);
void doAxialShFill(GfxAxialShading *shading);
void doRadialShFill(GfxRadialShading *shading);
void doGouraudTriangleShFill(GfxGouraudTriangleShading *shading);
void gouraudFillTriangle(double x0, double y0, GfxColor *color0,
double x1, double y1, GfxColor *color1,
double x2, double y2, GfxColor *color2,
int nComps, int depth);
void doPatchMeshShFill(GfxPatchMeshShading *shading);
void fillPatch(GfxPatch *patch, int nComps, int depth);
void doEndPath();
// path clipping operators
......
This diff is collapsed.
This diff is collapsed.
......@@ -56,8 +56,15 @@ void OutputDev::updateAll(GfxState *state) {
updateLineCap(state);
updateMiterLimit(state);
updateLineWidth(state);
updateFillColorSpace(state);
updateFillColor(state);
updateStrokeColorSpace(state);
updateStrokeColor(state);
updateBlendMode(state);
updateFillOpacity(state);
updateStrokeOpacity(state);
updateFillOverprint(state);
updateStrokeOverprint(state);
updateFont(state);
}
......@@ -96,6 +103,24 @@ void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
}
}
void OutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
Stream *maskStr,
int maskWidth, int maskHeight,
GBool maskInvert) {
drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
}
void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap) {
drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
}
#if OPI_SUPPORT
void OutputDev::opiBegin(GfxState *state, Dict *opiDict) {
}
......
......@@ -19,10 +19,12 @@
class GooHash;
class GooString;
class Object;
class GfxState;
class GfxColorSpace;
class GfxImageColorMap;
class GfxFunctionShading;
class GfxAxialShading;
class GfxRadialShading;
class Stream;
class Link;
class Catalog;
......@@ -49,6 +51,16 @@ public:
// Does this device use drawChar() or drawString()?
virtual GBool useDrawChar() = 0;
// Does this device use tilingPatternFill()? If this returns false,
// tiling pattern fills will be reduced to a series of other drawing
// operations.
virtual GBool useTilingPatternFill() { return gFalse; }
// Does this device use functionShadedFill(), axialShadedFill(), and
// radialShadedFill()? If this returns false, these shaded fills
// will be reduced to a series of other drawing operations.
virtual GBool useShadedFills() { return gFalse; }
// Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString.
virtual GBool interpretType3Chars() = 0;
......@@ -76,6 +88,9 @@ public:
virtual void cvtDevToUser(double dx, double dy, double *ux, double *uy);
virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy);
double *getDefCTM() { return defCTM; }
double *getDefICTM() { return defICTM; }
//----- link borders
virtual void drawLink(Link *link, Catalog *catalog) {}
......@@ -93,10 +108,15 @@ public:
virtual void updateLineCap(GfxState *state) {}
virtual void updateMiterLimit(GfxState *state) {}
virtual void updateLineWidth(GfxState *state) {}
virtual void updateFillColorSpace(GfxState *state) {}
virtual void updateStrokeColorSpace(GfxState *state) {}
virtual void updateFillColor(GfxState *state) {}
virtual void updateStrokeColor(GfxState *state) {}
virtual void updateBlendMode(GfxState *state) {}
virtual void updateFillOpacity(GfxState *state) {}
virtual void updateStrokeOpacity(GfxState *state) {}
virtual void updateFillOverprint(GfxState *state) {}
virtual void updateStrokeOverprint(GfxState *state) {}
//----- update text state
virtual void updateFont(GfxState *state) {}
......@@ -113,18 +133,29 @@ public:
virtual void stroke(GfxState *state) {}
virtual void fill(GfxState *state) {}
virtual void eoFill(GfxState *state) {}
virtual void tilingPatternFill(GfxState *state, Object *str,
int paintType, Dict *resDict,
double *mat, double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep) {}
virtual void functionShadedFill(GfxState *state,
GfxFunctionShading *shading) {}
virtual void axialShadedFill(GfxState *state, GfxAxialShading *shading) {}
virtual void radialShadedFill(GfxState *state, GfxRadialShading *shading) {}
//----- path clipping
virtual void clip(GfxState *state) {}
virtual void eoClip(GfxState *state) {}
//----- text drawing
virtual void beginStringOp(GfxState *state) {}
virtual void endStringOp(GfxState *state) {}
virtual void beginString(GfxState *state, GooString *s) {}
virtual void endString(GfxState *state) {}
virtual void drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode code, Unicode *u, int uLen) {}
CharCode code, int nBytes, Unicode *u, int uLen) {}
virtual void drawString(GfxState *state, GooString *s) {}
virtual GBool beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
......@@ -139,6 +170,17 @@ public:
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
int *maskColors, GBool inlineImg);
virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
Stream *maskStr, int maskWidth, int maskHeight,
GBool maskInvert);
virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap);
#if OPI_SUPPORT
//----- OPI functions
......
......@@ -17,6 +17,9 @@
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#ifdef WIN32
# include <windows.h>
#endif
#include "goo/GooString.h"
#include "poppler-config.h"
#include "GlobalParams.h"
......@@ -100,6 +103,63 @@ PDFDoc::PDFDoc(GooString *fileNameA, GooString *ownerPassword,
ok = setup(ownerPassword, userPassword);
}
#ifdef WIN32
PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
GooString *userPassword, void *guiDataA) {
OSVERSIONINFO version;
wchar_t fileName2[_MAX_PATH + 1];
Object obj;
int i;
ok = gFalse;
errCode = errNone;
guiData = guiDataA;
file = NULL;
str = NULL;
xref = NULL;
catalog = NULL;
links = NULL;
#ifndef DISABLE_OUTLINE
outline = NULL;
#endif
//~ file name should be stored in Unicode (?)
fileName = new GooString();
for (i = 0; i < fileNameLen; ++i) {
fileName->append((char)fileNameA[i]);
}
// zero-terminate the file name string
for (i = 0; i < fileNameLen && i < _MAX_PATH; ++i) {
fileName2[i] = fileNameA[i];
}
fileName2[i] = 0;
// try to open file
// NB: _wfopen is only available in NT
version.dwOSVersionInfoSize = sizeof(version);
GetVersionEx(&version);
if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
file = _wfopen(fileName2, L"rb");
} else {
file = fopen(fileName->getCString(), "rb");
}
if (!file) {
error(-1, "Couldn't open file '%s'", fileName->getCString());
errCode = errOpenFile;
return;
}
// create stream
obj.initNull();
str = new FileStream(file, 0, gFalse, 0, &obj);
ok = setup(ownerPassword, userPassword);
}
#endif
PDFDoc::PDFDoc(BaseStream *strA, GooString *ownerPassword,
GooString *userPassword, void *guiDataA) {
ok = gFalse;
......@@ -293,7 +353,7 @@ GBool PDFDoc::checkEncryption(GooString *ownerPassword, GooString *userPassword)
}
void PDFDoc::displayPage(OutputDev *out, int page, double hDPI, double vDPI,
int rotate, GBool crop, GBool doLinks,
int rotate, GBool useMediaBox, GBool crop, GBool doLinks,
GBool (*abortCheckCbk)(void *data),
void *abortCheckCbkData,
GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
......@@ -307,21 +367,20 @@ void PDFDoc::displayPage(OutputDev *out, int page, double hDPI, double vDPI,
if (doLinks) {
if (links) {
delete links;
links = NULL;
}
getLinks(p);
p->display(out, hDPI, vDPI, rotate, crop, links, catalog,
p->display(out, hDPI, vDPI, rotate, useMediaBox, crop, links, catalog,
abortCheckCbk, abortCheckCbkData,
annotDisplayDecideCbk, annotDisplayDecideCbkData);
} else {
p->display(out, hDPI, vDPI, rotate, crop, NULL, catalog,
p->display(out, hDPI, vDPI, rotate, useMediaBox, crop, NULL, catalog,
abortCheckCbk, abortCheckCbkData,
annotDisplayDecideCbk, annotDisplayDecideCbkData);
}
}
void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
double hDPI, double vDPI, int rotate,
double hDPI, double vDPI, int rotate, GBool useMediaBox,
GBool crop, GBool doLinks,
GBool (*abortCheckCbk)(void *data),
void *abortCheckCbkData,
......@@ -330,7 +389,7 @@ void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
int page;
for (page = firstPage; page <= lastPage; ++page) {
displayPage(out, page, hDPI, vDPI, rotate, crop, doLinks,
displayPage(out, page, hDPI, vDPI, rotate, useMediaBox, crop, doLinks,
abortCheckCbk, abortCheckCbkData,
annotDisplayDecideCbk, annotDisplayDecideCbkData);
}
......@@ -338,7 +397,7 @@ void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
void PDFDoc::displayPageSlice(OutputDev *out, int page,
double hDPI, double vDPI,
int rotate, GBool crop,
int rotate, GBool useMediaBox, GBool crop, GBool doLinks,
int sliceX, int sliceY, int sliceW, int sliceH,
GBool (*abortCheckCbk)(void *data),
void *abortCheckCbkData,
......@@ -347,11 +406,32 @@ void PDFDoc::displayPageSlice(OutputDev *out, int page,
Page *p;
p = catalog->getPage(page);
p->displaySlice(out, hDPI, vDPI, rotate, crop,
if (doLinks)
{
if (links) {
delete links;
}
getLinks(p);
p->displaySlice(out, hDPI, vDPI, rotate, useMediaBox, crop,
sliceX, sliceY, sliceW, sliceH,
NULL, catalog,
links, catalog,
abortCheckCbk, abortCheckCbkData,
annotDisplayDecideCbk, annotDisplayDecideCbkData);
} else {
p->displaySlice(out, hDPI, vDPI, rotate, useMediaBox, crop,
sliceX, sliceY, sliceW, sliceH,
NULL, catalog,
abortCheckCbk, abortCheckCbkData,
annotDisplayDecideCbk, annotDisplayDecideCbkData);
}
}
Links *PDFDoc::takeLinks() {
Links *ret;
ret = links;
links = NULL;
return ret;
}
GBool PDFDoc::isLinearized() {
......
......@@ -36,6 +36,12 @@ public:
PDFDoc(GooString *fileNameA, GooString *ownerPassword = NULL,
GooString *userPassword = NULL, void *guiDataA = NULL);
#ifdef WIN32
PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword = NULL,
GooString *userPassword = NULL, void *guiDataA = NULL);
#endif
PDFDoc(BaseStream *strA, GooString *ownerPassword = NULL,
GooString *userPassword = NULL, void *guiDataA = NULL);
~PDFDoc();
......@@ -59,10 +65,14 @@ public:
BaseStream *getBaseStream() { return str; }
// Get page parameters.
double getPageWidth(int page)
{ return catalog->getPage(page)->getWidth(); }
double getPageHeight(int page)
{ return catalog->getPage(page)->getHeight(); }
double getPageMediaWidth(int page)
{ return catalog->getPage(page)->getMediaWidth(); }
double getPageMediaHeight(int page)
{ return catalog->getPage(page)->getMediaHeight(); }
double getPageCropWidth(int page)
{ return catalog->getPage(page)->getCropWidth(); }
double getPageCropHeight(int page)
{ return catalog->getPage(page)->getCropHeight(); }
int getPageRotate(int page)
{ return catalog->getPage(page)->getRotate(); }
......@@ -78,7 +88,7 @@ public:
// Display a page.
void displayPage(OutputDev *out, int page, double hDPI, double vDPI,
int rotate, GBool crop, GBool doLinks,
int rotate, GBool useMediaBox, GBool crop, GBool doLinks,
GBool (*abortCheckCbk)(void *data) = NULL,
void *abortCheckCbkData = NULL,
GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL,
......@@ -87,7 +97,7 @@ public:
// Display a range of pages.
void displayPages(OutputDev *out, int firstPage, int lastPage,
double hDPI, double vDPI, int rotate,
GBool crop, GBool doLinks,
GBool useMediaBox, GBool crop, GBool doLinks,
GBool (*abortCheckCbk)(void *data) = NULL,
void *abortCheckCbkData = NULL,
GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL,
......@@ -96,7 +106,7 @@ public:
// Display part of a page.
void displayPageSlice(OutputDev *out, int page,
double hDPI, double vDPI,
int rotate, GBool crop,
int rotate, GBool useMediaBox, GBool crop, GBool doLinks,
int sliceX, int sliceY, int sliceW, int sliceH,
GBool (*abortCheckCbk)(void *data) = NULL,
void *abortCheckCbkData = NULL,
......
This diff is collapsed.
......@@ -26,6 +26,7 @@ class GfxSeparationColorSpace;
class PDFRectangle;
struct PSFont16Enc;
class PSOutCustomColor;
class Function;
//------------------------------------------------------------------------
// PSOutputDev
......@@ -83,6 +84,17 @@ public:
// Does this device use drawChar() or drawString()?
virtual GBool useDrawChar() { return gFalse; }
// Does this device use tilingPatternFill()? If this returns false,
// tiling pattern fills will be reduced to a series of other drawing
// operations.
virtual GBool useTilingPatternFill() { return gTrue; }
// Does this device use functionShadedFill(), axialShadedFill(), and
// radialShadedFill()? If this returns false, these shaded fills
// will be reduced to a series of other drawing operations.
virtual GBool useShadedFills()
{ return level == psLevel2 || level == psLevel3; }
// Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString.
virtual GBool interpretType3Chars() { return gFalse; }
......@@ -91,7 +103,8 @@ public:
// Write the document-level header.
void writeHeader(int firstPage, int lastPage,
PDFRectangle *mediaBox, PDFRectangle *cropBox);
PDFRectangle *mediaBox, PDFRectangle *cropBox,
int pageRotate);
// Write the Xpdf procset.
void writeXpdfProcset();
......@@ -99,9 +112,6 @@ public:
// Write the document-level setup.
void writeDocSetup(Catalog *catalog, int firstPage, int lastPage, GBool duplexA);
// Write the setup for the current page.
void writePageSetup();
// Write the trailer for the current page.
void writePageTrailer();
......@@ -129,8 +139,12 @@ public:
virtual void updateLineCap(GfxState *state);
virtual void updateMiterLimit(GfxState *state);
virtual void updateLineWidth(GfxState *state);
virtual void updateFillColorSpace(GfxState *state);
virtual void updateStrokeColorSpace(GfxState *state);
virtual void updateFillColor(GfxState *state);
virtual void updateStrokeColor(GfxState *state);
virtual void updateFillOverprint(GfxState *state);
virtual void updateStrokeOverprint(GfxState *state);
//----- update text state
virtual void updateFont(GfxState *state);
......@@ -147,6 +161,15 @@ public:
virtual void stroke(GfxState *state);
virtual void fill(GfxState *state);
virtual void eoFill(GfxState *state);
virtual void tilingPatternFill(GfxState *state, Object *str,
int paintType, Dict *resDict,
double *mat, double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep);
virtual void functionShadedFill(GfxState *state,
GfxFunctionShading *shading);
virtual void axialShadedFill(GfxState *state, GfxAxialShading *shading);
virtual void radialShadedFill(GfxState *state, GfxRadialShading *shading);
//----- path clipping
virtual void clip(GfxState *state);
......@@ -163,6 +186,11 @@ public:
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
int *maskColors, GBool inlineImg);
virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
Stream *maskStr, int maskWidth, int maskHeight,
GBool maskInvert);
#if OPI_SUPPORT
//----- OPI functions
......@@ -227,8 +255,11 @@ private:
Stream *str, int width, int height, int len);
void doImageL2(Object *ref, GfxImageColorMap *colorMap,
GBool invert, GBool inlineImg,
Stream *str, int width, int height, int len);
void dumpColorSpaceL2(GfxColorSpace *colorSpace);
Stream *str, int width, int height, int len,
int *maskColors, Stream *maskStr,
int maskWidth, int maskHeight, GBool maskInvert);
void dumpColorSpaceL2(GfxColorSpace *colorSpace,
GBool genXform, GBool updateColors);
#if OPI_SUPPORT
void opiBegin20(GfxState *state, Dict *dict);
void opiBegin13(GfxState *state, Dict *dict);
......@@ -236,6 +267,7 @@ private:
double *x1, double *y1);
GBool getFileSpec(Object *fileSpec, Object *fileName);
#endif
void cvtFunction(Function *func);
void writePSChar(char c);
void writePS(char *s);
void writePSFmt(const char *fmt, ...) GCC_PRINTF_FORMAT(2, 3);
......@@ -279,6 +311,8 @@ private:
GooList *xobjStack; // stack of XObject dicts currently being
// processed
int numSaves; // current number of gsaves
int numTilingPatterns; // current number of nested tiling patterns
int nextFunc; // next unique number to use for a function
double tx0, ty0; // global translation
double xScale0, yScale0; // global scaling
......@@ -288,6 +322,8 @@ private:
double tx, ty; // global translation for current page
double xScale, yScale; // global scaling for current page
int rotate; // rotation angle for current page
double epsX1, epsY1, // EPS bounding box (unrotated)
epsX2, epsY2;
GooString *embFontList; // resource comments for embedded fonts
......
......@@ -36,7 +36,6 @@
PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
Object obj1;
double w, h;
// get old/default values
if (attrs) {
......@@ -69,18 +68,6 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
cropBox = mediaBox;