X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FOutputDev.h;h=fdb0edcbe180afcef2fbc8dd53a2529dcaa22ea9;hb=f72fd5c03fec8c8d7220c4da964929442962d168;hp=d7de97abdf02fb104a535ec5ff129b2901ad56a6;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/pdf2swf/xpdf/OutputDev.h b/pdf2swf/xpdf/OutputDev.h index d7de97a..fdb0edc 100644 --- a/pdf2swf/xpdf/OutputDev.h +++ b/pdf2swf/xpdf/OutputDev.h @@ -2,23 +2,29 @@ // // OutputDev.h // -// Copyright 1996 Derek B. Noonburg +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== #ifndef OUTPUTDEV_H #define OUTPUTDEV_H -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma interface #endif #include "gtypes.h" +#include "CharTypes.h" class GString; class GfxState; class GfxColorSpace; class GfxImageColorMap; +class GfxFunctionShading; +class GfxAxialShading; +class GfxRadialShading; class Stream; class Link; class Catalog; @@ -45,10 +51,27 @@ 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; + + // Does this device need non-text content? + virtual GBool needNonText() { return gTrue; } + //----- initialization and control // Set default transform matrix. - virtual void setDefaultCTM(double *ctm1); + virtual void setDefaultCTM(double *ctm); // Start a page. virtual void startPage(int pageNum, GfxState *state) {} @@ -62,9 +85,12 @@ public: //----- coordinate conversion // Convert between device and user coordinates. - virtual void cvtDevToUser(int dx, int dy, double *ux, double *uy); + 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) {} @@ -82,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) {} @@ -102,20 +133,35 @@ 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, GString *s) {} virtual void endString(GfxState *state) {} virtual void drawChar(GfxState *state, double x, double y, - double dx, double dy, Guchar c) {} - virtual void drawChar16(GfxState *state, double x, double y, - double dx, double dy, int c) {} + double dx, double dy, + double originX, double originY, + CharCode code, int nBytes, Unicode *u, int uLen) {} virtual void drawString(GfxState *state, GString *s) {} - virtual void drawString16(GfxState *state, GString *s) {} + virtual GBool beginType3Char(GfxState *state, double x, double y, + double dx, double dy, + CharCode code, Unicode *u, int uLen); + virtual void endType3Char(GfxState *state) {} + virtual void endTextObject(GfxState *state) {} //----- image drawing virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, @@ -123,7 +169,18 @@ public: GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - GBool inlineImg); + 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 @@ -131,10 +188,18 @@ public: virtual void opiEnd(GfxState *state, Dict *opiDict); #endif + //----- Type 3 font operators + virtual void type3D0(GfxState *state, double wx, double wy) {} + virtual void type3D1(GfxState *state, double wx, double wy, + double llx, double lly, double urx, double ury) {} + + //----- PostScript XObjects + virtual void psXObject(Stream *psStream, Stream *level1Stream) {} + private: - double ctm[6]; // coordinate transform matrix - double ictm[6]; // inverse CTM + double defCTM[6]; // default coordinate transform matrix + double defICTM[6]; // inverse of default CTM }; #endif