1 //======================================================================== 2 // 3 // SplashState.h 4 // 5 //======================================================================== 6 7 #ifndef SPLASHSTATE_H 8 #define SPLASHSTATE_H 9 10 #ifdef USE_GCC_PRAGMAS 11 #pragma interface 12 #endif 13 14 #include "SplashTypes.h" 15 16 class SplashPattern; 17 class SplashScreen; 18 class SplashClip; 19 class SplashBitmap; 20 21 //------------------------------------------------------------------------ 22 // line cap values 23 //------------------------------------------------------------------------ 24 25 #define splashLineCapButt 0 26 #define splashLineCapRound 1 27 #define splashLineCapProjecting 2 28 29 //------------------------------------------------------------------------ 30 // line join values 31 //------------------------------------------------------------------------ 32 33 #define splashLineJoinMiter 0 34 #define splashLineJoinRound 1 35 #define splashLineJoinBevel 2 36 37 //------------------------------------------------------------------------ 38 // SplashState 39 //------------------------------------------------------------------------ 40 41 class SplashState { 42 public: 43 44 // Create a new state object, initialized with default settings. 45 SplashState(int width, int height, GBool vectorAntialias, 46 SplashScreenParams *screenParams); 47 SplashState(int width, int height, GBool vectorAntialias, 48 SplashScreen *screenA); 49 50 // Copy a state object. copy()51 SplashState *copy() { return new SplashState(this); } 52 53 ~SplashState(); 54 55 // Set the stroke pattern. This does not copy <strokePatternA>. 56 void setStrokePattern(SplashPattern *strokePatternA); 57 58 // Set the fill pattern. This does not copy <fillPatternA>. 59 void setFillPattern(SplashPattern *fillPatternA); 60 61 // Set the screen. This does not copy <screenA>. 62 void setScreen(SplashScreen *screenA); 63 64 // Set the line dash pattern. This copies the <lineDashA> array. 65 void setLineDash(SplashCoord *lineDashA, int lineDashLengthA, 66 SplashCoord lineDashPhaseA); 67 68 // Set the soft mask bitmap. 69 void setSoftMask(SplashBitmap *softMaskA); 70 71 private: 72 73 SplashState(SplashState *state); 74 75 SplashCoord matrix[6]; 76 SplashPattern *strokePattern; 77 SplashPattern *fillPattern; 78 SplashScreen *screen; 79 SplashBlendFunc blendFunc; 80 SplashCoord strokeAlpha; 81 SplashCoord fillAlpha; 82 SplashCoord lineWidth; 83 int lineCap; 84 int lineJoin; 85 SplashCoord miterLimit; 86 SplashCoord flatness; 87 SplashCoord *lineDash; 88 int lineDashLength; 89 SplashCoord lineDashPhase; 90 GBool strokeAdjust; 91 SplashClip *clip; 92 SplashBitmap *softMask; 93 GBool deleteSoftMask; 94 GBool inNonIsolatedGroup; 95 96 SplashState *next; // used by Splash class 97 98 friend class Splash; 99 }; 100 101 #endif 102