| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
| <title>SGL: SkSVGParser.h Source File</title> |
| <link href="doxygen.css" rel="stylesheet" type="text/css"> |
| </head><body> |
| <!-- Generated by Doxygen 1.4.0 --> |
| <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> |
| <div class="nav"> |
| <a class="el" href="dir_000000.html">include</a> / <a class="el" href="dir_000001.html">skia</a></div> |
| <h1>SkSVGParser.h</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef SkSVGParser_DEFINED</span> |
| 00002 <span class="preprocessor"></span><span class="preprocessor">#define SkSVGParser_DEFINED</span> |
| 00003 <span class="preprocessor"></span> |
| 00004 <span class="preprocessor">#include "SkMatrix.h"</span> |
| 00005 <span class="preprocessor">#include "SkTDict.h"</span> |
| 00006 <span class="preprocessor">#include "SkTDStack.h"</span> |
| 00007 <span class="preprocessor">#include "SkSVGPaintState.h"</span> |
| 00008 <span class="preprocessor">#include "SkSVGTypes.h"</span> |
| 00009 <span class="preprocessor">#include "SkStream.h"</span> |
| 00010 <span class="preprocessor">#include "SkString.h"</span> |
| 00011 <span class="preprocessor">#include "SkXMLParser.h"</span> |
| 00012 <span class="preprocessor">#include "SkXMLWriter.h"</span> |
| 00013 |
| 00014 <span class="keyword">class </span>SkSVGBase; |
| 00015 <span class="keyword">class </span>SkSVGElement; |
| 00016 |
| 00017 <span class="keyword">class </span>SkSVGParser : <span class="keyword">public</span> SkXMLParser { |
| 00018 <span class="keyword">public</span>: |
| 00019 SkSVGParser(); |
| 00020 <span class="keyword">virtual</span> ~SkSVGParser(); |
| 00021 <span class="keywordtype">void</span> _addAttribute(<span class="keyword">const</span> <span class="keywordtype">char</span>* attrName, <span class="keyword">const</span> <span class="keywordtype">char</span>* attrValue) { |
| 00022 fXMLWriter.addAttribute(attrName, attrValue); } |
| 00023 <span class="keywordtype">void</span> _addAttribute(<span class="keyword">const</span> <span class="keywordtype">char</span>* attrName, <a class="code" href="classSkString.html">SkString</a>& attrValue) { |
| 00024 fXMLWriter.addAttribute(attrName, attrValue.c_str()); } |
| 00025 <span class="keywordtype">void</span> _addAttributeLen(<span class="keyword">const</span> <span class="keywordtype">char</span>* attrName, <span class="keyword">const</span> <span class="keywordtype">char</span>* attrValue, size_t len) { |
| 00026 fXMLWriter.addAttributeLen(attrName, attrValue, len); } |
| 00027 <span class="keywordtype">void</span> _endElement() { fXMLWriter.endElement(); } |
| 00028 <span class="keywordtype">int</span> findAttribute(SkSVGBase* , <span class="keyword">const</span> <span class="keywordtype">char</span>* attrValue, size_t len, <span class="keywordtype">bool</span> isPaint); |
| 00029 <span class="keyword">const</span> <span class="keywordtype">char</span>* getFinal(); |
| 00030 SkTDict<SkSVGElement*>& getIDs() { <span class="keywordflow">return</span> fIDs; } |
| 00031 <a class="code" href="classSkString.html">SkString</a>& getPaintLast(SkSVGPaint::Field field); |
| 00032 <span class="keywordtype">void</span> _startElement(<span class="keyword">const</span> <span class="keywordtype">char</span> name[]) { fXMLWriter.startElement(name); } |
| 00033 <span class="keywordtype">void</span> translate(SkSVGElement*, <span class="keywordtype">bool</span> isDef); |
| 00034 <span class="keywordtype">void</span> translateMatrix(<a class="code" href="classSkString.html">SkString</a>& , <a class="code" href="classSkString.html">SkString</a>* <span class="keywordtype">id</span>); |
| 00035 <span class="keyword">static</span> <span class="keywordtype">void</span> ConvertToArray(<a class="code" href="classSkString.html">SkString</a>& vals); |
| 00036 <span class="keyword">protected</span>: |
| 00037 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onAddAttribute(<span class="keyword">const</span> <span class="keywordtype">char</span> name[], <span class="keyword">const</span> <span class="keywordtype">char</span> value[]); |
| 00038 <span class="keywordtype">bool</span> onAddAttributeLen(<span class="keyword">const</span> <span class="keywordtype">char</span> name[], <span class="keyword">const</span> <span class="keywordtype">char</span> value[], size_t len); |
| 00039 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onEndElement(<span class="keyword">const</span> <span class="keywordtype">char</span> elem[]); |
| 00040 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onStartElement(<span class="keyword">const</span> <span class="keywordtype">char</span> elem[]); |
| 00041 <span class="keywordtype">bool</span> onStartElementLen(<span class="keyword">const</span> <span class="keywordtype">char</span> elem[], size_t len); |
| 00042 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onText(<span class="keyword">const</span> <span class="keywordtype">char</span> text[], <span class="keywordtype">int</span> len); |
| 00043 <span class="keyword">private</span>: |
| 00044 <span class="keywordtype">bool</span> isStrokeAndFill(SkSVGPaint** stroke, SkSVGPaint** fill); |
| 00045 <span class="keyword">static</span> SkSVGElement* CreateElement(SkSVGTypes type, SkSVGElement* parent); |
| 00046 <span class="keyword">static</span> <span class="keywordtype">void</span> Delete(SkTDArray<SkSVGElement*>& fChildren); |
| 00047 <span class="keyword">static</span> SkSVGTypes GetType(<span class="keyword">const</span> <span class="keywordtype">char</span> name[], size_t len); |
| 00048 SkSVGPaint* fHead; |
| 00049 SkSVGPaint fEmptyPaint; |
| 00050 SkSVGPaint fLastFlush; |
| 00051 <a class="code" href="classSkString.html">SkString</a> fLastColor; |
| 00052 SkMatrix fLastTransform; |
| 00053 SkTDArray<SkSVGElement*> fChildren; |
| 00054 SkTDict<SkSVGElement*> fIDs; |
| 00055 SkTDArray<SkSVGElement*> fParents; |
| 00056 SkMemoryWStream fStream; |
| 00057 SkXMLStreamWriter fXMLWriter; |
| 00058 SkSVGElement* fCurrElement; |
| 00059 SkBool8 fInSVG; |
| 00060 SkBool8 fSuppressPaint; |
| 00061 <span class="keyword">friend</span> <span class="keyword">class </span>SkSVGPaint; |
| 00062 <span class="keyword">friend</span> <span class="keyword">class </span>SkSVGGradient; |
| 00063 }; |
| 00064 |
| 00065 <span class="preprocessor">#endif // SkSVGParser_DEFINED</span> |
| </pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue May 9 14:35:23 2006 for SGL by |
| <a href="http://www.doxygen.org/index.html"> |
| <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.0 </small></address> |
| </body> |
| </html> |