X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FGfx.h;h=2e40a57374a3b6fb3d77129a42151a057578a206;hp=b4da531cf47a068df0ed35313dad9c7d20fed6fe;hb=c7432833fe3a6469d63fad135151a92e12877b94;hpb=b9ddd4a2ed601bc01ddacc69d2522687a93a94ce diff --git a/pdf2swf/xpdf/Gfx.h b/pdf2swf/xpdf/Gfx.h index b4da531..2e40a57 100644 --- a/pdf2swf/xpdf/Gfx.h +++ b/pdf2swf/xpdf/Gfx.h @@ -2,14 +2,16 @@ // // Gfx.h // -// Copyright 1996-2002 Glyph & Cog, LLC +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== #ifndef GFX_H #define GFX_H -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma interface #endif @@ -25,12 +27,16 @@ class OutputDev; class GfxFontDict; class GfxFont; class GfxPattern; +class GfxTilingPattern; +class GfxShadingPattern; class GfxShading; +class GfxFunctionShading; class GfxAxialShading; class GfxRadialShading; class GfxState; +struct GfxColor; class Gfx; -struct PDFRectangle; +class PDFRectangle; //------------------------------------------------------------------------ // Gfx @@ -94,13 +100,17 @@ class Gfx { public: // Constructor for regular output. - Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, double dpi, - PDFRectangle *box, GBool crop, PDFRectangle *cropBox, int rotate, - GBool printCommandsA); + Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, + double hDPI, double vDPI, PDFRectangle *box, GBool crop, + 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, GBool crop, PDFRectangle *cropBox, + GBool (*abortCheckCbkA)(void *data) = NULL, + void *abortCheckCbkDataA = NULL); ~Gfx(); @@ -112,8 +122,11 @@ public: void doAnnot(Object *str, double xMin, double yMin, double xMax, double yMax); - void pushResources(Dict *resDict); - void popResources(); + // Save graphics state. + void saveState(); + + // Restore graphics state. + void restoreState(); private: @@ -130,9 +143,14 @@ private: int ignoreUndef; // current BX/EX nesting level double baseMatrix[6]; // default matrix for most recent // page/form/pattern + int formDepth; Parser *parser; // parser for page content stream(s) + GBool // callback to check for an abort + (*abortCheckCbk)(void *data); + void *abortCheckCbkData; + static Operator opTab[]; // table of operators void go(GBool topLevel); @@ -188,7 +206,14 @@ private: void opEOFillStroke(Object args[], int numArgs); void opCloseEOFillStroke(Object args[], int numArgs); void doPatternFill(GBool eoFill); + void doTilingPatternFill(GfxTilingPattern *tPat, GBool eoFill); + void doShadingPatternFill(GfxShadingPattern *sPat, GBool eoFill); void opShFill(Object args[], int numArgs); + void doFunctionShFill(GfxFunctionShading *shading); + void doFunctionShFill1(GfxFunctionShading *shading, + double x0, double y0, + double x1, double y1, + GfxColor *colors, int depth); void doAxialShFill(GfxAxialShading *shading); void doRadialShFill(GfxRadialShading *shading); void doEndPath(); @@ -247,6 +272,9 @@ private: void opBeginMarkedContent(Object args[], int numArgs); void opEndMarkedContent(Object args[], int numArgs); void opMarkPoint(Object args[], int numArgs); + + void pushResources(Dict *resDict); + void popResources(); }; #endif