00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SkSVGPaintState_DEFINED
00018 #define SkSVGPaintState_DEFINED
00019
00020 #include "SkSVGBase.h"
00021 #include "SkString.h"
00022
00023 class SkSVGPaint : public SkSVGBase {
00024 public:
00025 enum Field {
00026 kInitial = -1,
00027 kClipPath,
00028 kClipRule,
00029 kEnableBackground,
00030 kFill,
00031 kFillRule,
00032 kFilter,
00033 kFontFamily,
00034 kFontSize,
00035 kLetterSpacing,
00036 kMask,
00037 kOpacity,
00038 kStopColor,
00039 kStopOpacity,
00040 kStroke,
00041 kStroke_Dasharray,
00042 kStroke_Linecap,
00043 kStroke_Linejoin,
00044 kStroke_Miterlimit,
00045 kStroke_Width,
00046 kStyle,
00047 kTransform,
00048 kTerminal
00049 };
00050
00051 SkSVGPaint();
00052 virtual void addAttribute(SkSVGParser& parser, int attrIndex,
00053 const char* attrValue, size_t attrLength);
00054 bool flush(SkSVGParser& , bool isFlushable, bool isDef);
00055 virtual int getAttributes(const SkSVGAttribute** attrPtr);
00056 static void Push(SkSVGPaint** head, SkSVGPaint* add);
00057 static void Pop(SkSVGPaint** head);
00058 SkString* operator[](int index);
00059 SkString fInitial;
00060 SkString f_clipPath;
00061 SkString f_clipRule;
00062 SkString f_enableBackground;
00063 SkString f_fill;
00064 SkString f_fillRule;
00065 SkString f_filter;
00066 SkString f_fontFamily;
00067 SkString f_fontSize;
00068 SkString f_letterSpacing;
00069 SkString f_mask;
00070 SkString f_opacity;
00071 SkString f_stopColor;
00072 SkString f_stopOpacity;
00073 SkString f_stroke;
00074 SkString f_strokeDasharray;
00075 SkString f_strokeLinecap;
00076 SkString f_strokeLinejoin;
00077 SkString f_strokeMiterlimit;
00078 SkString f_strokeWidth;
00079 SkString f_style;
00080 SkString f_transform;
00081 #ifdef SK_DEBUG
00082 SkString fTerminal;
00083 #endif
00084 SkString fTransformID;
00085 static SkSVGAttribute gAttributes[];
00086 static const int kAttributesSize;
00087 private:
00088 void setSave(SkSVGParser& );
00089 bool writeChangedAttributes(SkSVGParser& , SkSVGPaint& , bool* changed);
00090 bool writeChangedElements(SkSVGParser& , SkSVGPaint& , bool* changed);
00091 SkSVGPaint* fNext;
00092 friend class SkSVGParser;
00093 typedef SkSVGPaint BASE_CLASS;
00094 };
00095
00096 #endif // SkSVGPaintState_DEFINED