blob: b7883c56b395aac43d72331413e7ad23b5c68192 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Skia: /Volumes/disk/skia/trunk/include/svg/SkSVGParser.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<h1>/Volumes/disk/skia/trunk/include/svg/SkSVGParser.h</h1><a href="_sk_s_v_g_parser_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2006 The Android Open Source Project</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef SkSVGParser_DEFINED</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define SkSVGParser_DEFINED</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="_sk_matrix_8h.html">SkMatrix.h</a>&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;<a class="code" href="_sk_t_dict_8h.html">SkTDict.h</a>&quot;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="_sk_t_d_stack_8h.html">SkTDStack.h</a>&quot;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="_sk_s_v_g_paint_state_8h.html">SkSVGPaintState.h</a>&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;<a class="code" href="_sk_s_v_g_types_8h.html">SkSVGTypes.h</a>&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;<a class="code" href="_sk_stream_8h.html">SkStream.h</a>&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="_sk_string_8h.html">SkString.h</a>&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="_sk_x_m_l_parser_8h.html">SkXMLParser.h</a>&quot;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="_sk_x_m_l_writer_8h.html">SkXMLWriter.h</a>&quot;</span>
<a name="l00029"></a>00029
<a name="l00030"></a>00030 <span class="keyword">class </span><a class="code" href="class_sk_s_v_g_base.html">SkSVGBase</a>;
<a name="l00031"></a>00031 <span class="keyword">class </span>SkSVGElement;
<a name="l00032"></a>00032
<a name="l00033"></a><a class="code" href="class_sk_s_v_g_parser.html">00033</a> <span class="keyword">class </span><a class="code" href="class_sk_s_v_g_parser.html">SkSVGParser</a> : <span class="keyword">public</span> <a class="code" href="class_sk_x_m_l_parser.html">SkXMLParser</a> {
<a name="l00034"></a>00034 <span class="keyword">public</span>:
<a name="l00035"></a>00035 <a class="code" href="class_sk_s_v_g_parser.html#ab0b2d622a5b36f638d8117182da98a58">SkSVGParser</a>();
<a name="l00036"></a>00036 <span class="keyword">virtual</span> <a class="code" href="class_sk_s_v_g_parser.html#a931189f91a60943fcc00ed634da79e09">~SkSVGParser</a>();
<a name="l00037"></a><a class="code" href="class_sk_s_v_g_parser.html#a9a0d09099d428190bdf92c46d7ee8a1a">00037</a> <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#a9a0d09099d428190bdf92c46d7ee8a1a">_addAttribute</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* attrName, <span class="keyword">const</span> <span class="keywordtype">char</span>* attrValue) {
<a name="l00038"></a>00038 fXMLWriter.<a class="code" href="class_sk_x_m_l_writer.html#ab94bfc260157ce64794c999e0e9df9b8">addAttribute</a>(attrName, attrValue); }
<a name="l00039"></a><a class="code" href="class_sk_s_v_g_parser.html#a6e7f398ee1f404145ec291d647e6fe47">00039</a> <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#a6e7f398ee1f404145ec291d647e6fe47">_addAttribute</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* attrName, <a class="code" href="class_sk_string.html">SkString</a>&amp; attrValue) {
<a name="l00040"></a>00040 fXMLWriter.<a class="code" href="class_sk_x_m_l_writer.html#ab94bfc260157ce64794c999e0e9df9b8">addAttribute</a>(attrName, attrValue.<a class="code" href="class_sk_string.html#a4ff83aabdb32d6b9edbfcbf910adb07e">c_str</a>()); }
<a name="l00041"></a><a class="code" href="class_sk_s_v_g_parser.html#a655989aedfb53ae50386949091b146cb">00041</a> <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#a655989aedfb53ae50386949091b146cb">_addAttributeLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* attrName, <span class="keyword">const</span> <span class="keywordtype">char</span>* attrValue, <span class="keywordtype">size_t</span> len) {
<a name="l00042"></a>00042 fXMLWriter.<a class="code" href="class_sk_x_m_l_writer.html#a2fb2f02d2de83050683a2dd0bc9f5780">addAttributeLen</a>(attrName, attrValue, len); }
<a name="l00043"></a><a class="code" href="class_sk_s_v_g_parser.html#a32d04cab55d6b5287dd7d3d83351bf7b">00043</a> <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#a32d04cab55d6b5287dd7d3d83351bf7b">_endElement</a>() { fXMLWriter.<a class="code" href="class_sk_x_m_l_writer.html#af96f9d6b438b5739842e5e96626ee764">endElement</a>(); }
<a name="l00044"></a>00044 <span class="keywordtype">int</span> <a class="code" href="class_sk_s_v_g_parser.html#afeff2555b5e330f8a9183771cf148778">findAttribute</a>(<a class="code" href="class_sk_s_v_g_base.html">SkSVGBase</a>* , <span class="keyword">const</span> <span class="keywordtype">char</span>* attrValue, <span class="keywordtype">size_t</span> len, <span class="keywordtype">bool</span> isPaint);
<a name="l00045"></a>00045 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_sk_s_v_g_parser.html#a4ba67a439d8d7d3f61a952106fa459f5">getFinal</a>();
<a name="l00046"></a><a class="code" href="class_sk_s_v_g_parser.html#a214891ec410068eda7b17b426c77e16d">00046</a> <a class="code" href="class_sk_t_dict.html">SkTDict&lt;SkSVGElement*&gt;</a>&amp; <a class="code" href="class_sk_s_v_g_parser.html#a214891ec410068eda7b17b426c77e16d">getIDs</a>() { <span class="keywordflow">return</span> fIDs; }
<a name="l00047"></a>00047 <a class="code" href="class_sk_string.html">SkString</a>&amp; <a class="code" href="class_sk_s_v_g_parser.html#a41c335be948f2f8548e619ac813ca765">getPaintLast</a>(<a class="code" href="class_sk_s_v_g_paint.html#ab7cb3b7d439ba83082bbc0038716ac23">SkSVGPaint::Field</a> field);
<a name="l00048"></a><a class="code" href="class_sk_s_v_g_parser.html#a9e95082aca9e9ccc656a3afdbf90b6f6">00048</a> <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#a9e95082aca9e9ccc656a3afdbf90b6f6">_startElement</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> name[]) { fXMLWriter.<a class="code" href="class_sk_x_m_l_writer.html#afdd256b5e65652ff507ac2bb4d7058e1">startElement</a>(name); }
<a name="l00049"></a>00049 <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#a959bf083acc7080e3480b18d77577677">translate</a>(SkSVGElement*, <span class="keywordtype">bool</span> isDef);
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#aba8ed30c5ccdba3b8f9a23cf4087f20a">translateMatrix</a>(<a class="code" href="class_sk_string.html">SkString</a>&amp; , <a class="code" href="class_sk_string.html">SkString</a>* <span class="keywordtype">id</span>);
<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_sk_s_v_g_parser.html#a66fea0877c53b6a3c5f4b4c0de104efc">ConvertToArray</a>(<a class="code" href="class_sk_string.html">SkString</a>&amp; vals);
<a name="l00052"></a>00052 <span class="keyword">protected</span>:
<a name="l00053"></a>00053 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_sk_s_v_g_parser.html#a046d627a74e0da369cba52253c1746e4">onAddAttribute</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> name[], <span class="keyword">const</span> <span class="keywordtype">char</span> value[]);
<a name="l00054"></a>00054 <span class="keywordtype">bool</span> <a class="code" href="class_sk_s_v_g_parser.html#af8f6db2d27bd066aaac794cf43c8ff8f">onAddAttributeLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> name[], <span class="keyword">const</span> <span class="keywordtype">char</span> value[], <span class="keywordtype">size_t</span> len);
<a name="l00055"></a>00055 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_sk_s_v_g_parser.html#afca713f7b77af08bd6b9e41473c4edb3">onEndElement</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> elem[]);
<a name="l00056"></a>00056 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_sk_s_v_g_parser.html#a2d055c6be70021e9e3f234ece76f75c3">onStartElement</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> elem[]);
<a name="l00057"></a>00057 <span class="keywordtype">bool</span> <a class="code" href="class_sk_s_v_g_parser.html#ada166b72bf21cd5ce24449c3d5bd34c8">onStartElementLen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> elem[], <span class="keywordtype">size_t</span> len);
<a name="l00058"></a>00058 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_sk_s_v_g_parser.html#a466dc1ee0fc1368258e73ce92cb492e6">onText</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="class_sk_x_m_l_parser.html#a491e669691429739bd117cbd9aa898d9">text</a>[], <span class="keywordtype">int</span> len);
<a name="l00059"></a>00059 <span class="keyword">private</span>:
<a name="l00060"></a>00060 <span class="keywordtype">bool</span> isStrokeAndFill(<a class="code" href="class_sk_s_v_g_paint.html">SkSVGPaint</a>** stroke, <a class="code" href="class_sk_s_v_g_paint.html">SkSVGPaint</a>** fill);
<a name="l00061"></a>00061 <span class="keyword">static</span> SkSVGElement* CreateElement(<a class="code" href="_sk_s_v_g_types_8h.html#aa91ad3f593b52893b1e4a6f99843ec82">SkSVGTypes</a> type, SkSVGElement* parent);
<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">void</span> Delete(<a class="code" href="class_sk_t_d_array.html">SkTDArray&lt;SkSVGElement*&gt;</a>&amp; fChildren);
<a name="l00063"></a>00063 <span class="keyword">static</span> <a class="code" href="_sk_s_v_g_types_8h.html#aa91ad3f593b52893b1e4a6f99843ec82">SkSVGTypes</a> GetType(<span class="keyword">const</span> <span class="keywordtype">char</span> name[], <span class="keywordtype">size_t</span> len);
<a name="l00064"></a>00064 <a class="code" href="class_sk_s_v_g_paint.html">SkSVGPaint</a>* fHead;
<a name="l00065"></a>00065 <a class="code" href="class_sk_s_v_g_paint.html">SkSVGPaint</a> fEmptyPaint;
<a name="l00066"></a>00066 <a class="code" href="class_sk_s_v_g_paint.html">SkSVGPaint</a> fLastFlush;
<a name="l00067"></a>00067 <a class="code" href="class_sk_string.html">SkString</a> fLastColor;
<a name="l00068"></a>00068 <a class="code" href="class_sk_matrix.html">SkMatrix</a> fLastTransform;
<a name="l00069"></a>00069 <a class="code" href="class_sk_t_d_array.html">SkTDArray&lt;SkSVGElement*&gt;</a> fChildren;
<a name="l00070"></a>00070 <a class="code" href="class_sk_t_dict.html">SkTDict&lt;SkSVGElement*&gt;</a> fIDs;
<a name="l00071"></a>00071 <a class="code" href="class_sk_t_d_array.html">SkTDArray&lt;SkSVGElement*&gt;</a> fParents;
<a name="l00072"></a>00072 <a class="code" href="class_sk_dynamic_memory_w_stream.html">SkDynamicMemoryWStream</a> fStream;
<a name="l00073"></a>00073 <a class="code" href="class_sk_x_m_l_stream_writer.html">SkXMLStreamWriter</a> fXMLWriter;
<a name="l00074"></a>00074 SkSVGElement* fCurrElement;
<a name="l00075"></a>00075 <a class="code" href="_sk_types_8h.html#a6c7dec5c0a40866075ef185dd7a3eb42">SkBool8</a> fInSVG;
<a name="l00076"></a>00076 <a class="code" href="_sk_types_8h.html#a6c7dec5c0a40866075ef185dd7a3eb42">SkBool8</a> fSuppressPaint;
<a name="l00077"></a><a class="code" href="class_sk_s_v_g_parser.html#aea5c5335e9e52d3578bd91d5641ef847">00077</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_sk_s_v_g_paint.html">SkSVGPaint</a>;
<a name="l00078"></a><a class="code" href="class_sk_s_v_g_parser.html#ab69482659959c85df21be54c3d2d71db">00078</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_sk_s_v_g_parser.html#ab69482659959c85df21be54c3d2d71db">SkSVGGradient</a>;
<a name="l00079"></a>00079 };
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="preprocessor">#endif // SkSVGParser_DEFINED</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Oct 20 10:33:00 2009 for Skia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>