michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkSVGPaintState_DEFINED michael@0: #define SkSVGPaintState_DEFINED michael@0: michael@0: #include "SkSVGBase.h" michael@0: #include "SkString.h" michael@0: michael@0: class SkSVGPaint : public SkSVGBase { michael@0: public: michael@0: enum Field { michael@0: kInitial = -1, michael@0: kClipPath, michael@0: kClipRule, michael@0: kEnableBackground, michael@0: kFill, michael@0: kFillRule, michael@0: kFilter, michael@0: kFontFamily, michael@0: kFontSize, michael@0: kLetterSpacing, michael@0: kMask, michael@0: kOpacity, michael@0: kStopColor, michael@0: kStopOpacity, michael@0: kStroke, michael@0: kStroke_Dasharray, michael@0: kStroke_Linecap, michael@0: kStroke_Linejoin, michael@0: kStroke_Miterlimit, michael@0: kStroke_Width, michael@0: kStyle, michael@0: kTransform, michael@0: kTerminal michael@0: }; michael@0: michael@0: SkSVGPaint(); michael@0: virtual void addAttribute(SkSVGParser& parser, int attrIndex, michael@0: const char* attrValue, size_t attrLength); michael@0: bool flush(SkSVGParser& , bool isFlushable, bool isDef); michael@0: virtual int getAttributes(const SkSVGAttribute** attrPtr); michael@0: static void Push(SkSVGPaint** head, SkSVGPaint* add); michael@0: static void Pop(SkSVGPaint** head); michael@0: SkString* operator[](int index); michael@0: SkString fInitial; michael@0: SkString f_clipPath; michael@0: SkString f_clipRule; michael@0: SkString f_enableBackground; michael@0: SkString f_fill; michael@0: SkString f_fillRule; michael@0: SkString f_filter; michael@0: SkString f_fontFamily; michael@0: SkString f_fontSize; michael@0: SkString f_letterSpacing; michael@0: SkString f_mask; michael@0: SkString f_opacity; michael@0: SkString f_stopColor; michael@0: SkString f_stopOpacity; michael@0: SkString f_stroke; michael@0: SkString f_strokeDasharray; michael@0: SkString f_strokeLinecap; michael@0: SkString f_strokeLinejoin; michael@0: SkString f_strokeMiterlimit; michael@0: SkString f_strokeWidth; michael@0: SkString f_style; // unused, but allows array access to the rest michael@0: SkString f_transform; michael@0: #ifdef SK_DEBUG michael@0: SkString fTerminal; michael@0: #endif michael@0: SkString fTransformID; michael@0: static SkSVGAttribute gAttributes[]; michael@0: static const int kAttributesSize; michael@0: private: michael@0: void setSave(SkSVGParser& ); michael@0: bool writeChangedAttributes(SkSVGParser& , SkSVGPaint& , bool* changed); michael@0: bool writeChangedElements(SkSVGParser& , SkSVGPaint& , bool* changed); michael@0: SkSVGPaint* fNext; michael@0: friend class SkSVGParser; michael@0: typedef SkSVGPaint BASE_CLASS; michael@0: }; michael@0: michael@0: #endif // SkSVGPaintState_DEFINED