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