comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/gtk-doc/html/cairo/cairo-Paths.html @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 68:5028fdace37b
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Paths: Cairo: A Vector Graphics Library</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8 <link rel="up" href="cairo-drawing.html" title="Drawing">
9 <link rel="prev" href="cairo-cairo-t.html" title="cairo_t">
10 <link rel="next" href="cairo-cairo-pattern-t.html" title="cairo_pattern_t">
11 <meta name="generator" content="GTK-Doc V1.27 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18 <a href="#cairo-Paths.description" class="shortcut">Description</a></span>
19 </td>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="cairo-drawing.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="cairo-cairo-t.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="cairo-cairo-pattern-t.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
24 </tr></table>
25 <div class="refentry">
26 <a name="cairo-Paths"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
29 <h2><span class="refentrytitle"><a name="cairo-Paths.top_of_page"></a>Paths</span></h2>
30 <p>Paths — Creating paths and manipulating path data</p>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
34 <div class="refsect1">
35 <a name="cairo-Paths.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
37 <colgroup>
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
40 </colgroup>
41 <tbody>
42 <tr>
43 <td class="function_type">
44 <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="returnvalue">cairo_path_t</span></a> *
45 </td>
46 <td class="function_name">
47 <a class="link" href="cairo-Paths.html#cairo-copy-path" title="cairo_copy_path ()">cairo_copy_path</a> <span class="c_punctuation">()</span>
48 </td>
49 </tr>
50 <tr>
51 <td class="function_type">
52 <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="returnvalue">cairo_path_t</span></a> *
53 </td>
54 <td class="function_name">
55 <a class="link" href="cairo-Paths.html#cairo-copy-path-flat" title="cairo_copy_path_flat ()">cairo_copy_path_flat</a> <span class="c_punctuation">()</span>
56 </td>
57 </tr>
58 <tr>
59 <td class="function_type">
60 <span class="returnvalue">void</span>
61 </td>
62 <td class="function_name">
63 <a class="link" href="cairo-Paths.html#cairo-path-destroy" title="cairo_path_destroy ()">cairo_path_destroy</a> <span class="c_punctuation">()</span>
64 </td>
65 </tr>
66 <tr>
67 <td class="function_type">
68 <span class="returnvalue">void</span>
69 </td>
70 <td class="function_name">
71 <a class="link" href="cairo-Paths.html#cairo-append-path" title="cairo_append_path ()">cairo_append_path</a> <span class="c_punctuation">()</span>
72 </td>
73 </tr>
74 <tr>
75 <td class="function_type">
76 <a class="link" href="cairo-Types.html#cairo-bool-t" title="cairo_bool_t"><span class="returnvalue">cairo_bool_t</span></a>
77 </td>
78 <td class="function_name">
79 <a class="link" href="cairo-Paths.html#cairo-has-current-point" title="cairo_has_current_point ()">cairo_has_current_point</a> <span class="c_punctuation">()</span>
80 </td>
81 </tr>
82 <tr>
83 <td class="function_type">
84 <span class="returnvalue">void</span>
85 </td>
86 <td class="function_name">
87 <a class="link" href="cairo-Paths.html#cairo-get-current-point" title="cairo_get_current_point ()">cairo_get_current_point</a> <span class="c_punctuation">()</span>
88 </td>
89 </tr>
90 <tr>
91 <td class="function_type">
92 <span class="returnvalue">void</span>
93 </td>
94 <td class="function_name">
95 <a class="link" href="cairo-Paths.html#cairo-new-path" title="cairo_new_path ()">cairo_new_path</a> <span class="c_punctuation">()</span>
96 </td>
97 </tr>
98 <tr>
99 <td class="function_type">
100 <span class="returnvalue">void</span>
101 </td>
102 <td class="function_name">
103 <a class="link" href="cairo-Paths.html#cairo-new-sub-path" title="cairo_new_sub_path ()">cairo_new_sub_path</a> <span class="c_punctuation">()</span>
104 </td>
105 </tr>
106 <tr>
107 <td class="function_type">
108 <span class="returnvalue">void</span>
109 </td>
110 <td class="function_name">
111 <a class="link" href="cairo-Paths.html#cairo-close-path" title="cairo_close_path ()">cairo_close_path</a> <span class="c_punctuation">()</span>
112 </td>
113 </tr>
114 <tr>
115 <td class="function_type">
116 <span class="returnvalue">void</span>
117 </td>
118 <td class="function_name">
119 <a class="link" href="cairo-Paths.html#cairo-arc" title="cairo_arc ()">cairo_arc</a> <span class="c_punctuation">()</span>
120 </td>
121 </tr>
122 <tr>
123 <td class="function_type">
124 <span class="returnvalue">void</span>
125 </td>
126 <td class="function_name">
127 <a class="link" href="cairo-Paths.html#cairo-arc-negative" title="cairo_arc_negative ()">cairo_arc_negative</a> <span class="c_punctuation">()</span>
128 </td>
129 </tr>
130 <tr>
131 <td class="function_type">
132 <span class="returnvalue">void</span>
133 </td>
134 <td class="function_name">
135 <a class="link" href="cairo-Paths.html#cairo-curve-to" title="cairo_curve_to ()">cairo_curve_to</a> <span class="c_punctuation">()</span>
136 </td>
137 </tr>
138 <tr>
139 <td class="function_type">
140 <span class="returnvalue">void</span>
141 </td>
142 <td class="function_name">
143 <a class="link" href="cairo-Paths.html#cairo-line-to" title="cairo_line_to ()">cairo_line_to</a> <span class="c_punctuation">()</span>
144 </td>
145 </tr>
146 <tr>
147 <td class="function_type">
148 <span class="returnvalue">void</span>
149 </td>
150 <td class="function_name">
151 <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()">cairo_move_to</a> <span class="c_punctuation">()</span>
152 </td>
153 </tr>
154 <tr>
155 <td class="function_type">
156 <span class="returnvalue">void</span>
157 </td>
158 <td class="function_name">
159 <a class="link" href="cairo-Paths.html#cairo-rectangle" title="cairo_rectangle ()">cairo_rectangle</a> <span class="c_punctuation">()</span>
160 </td>
161 </tr>
162 <tr>
163 <td class="function_type">
164 <span class="returnvalue">void</span>
165 </td>
166 <td class="function_name">
167 <a class="link" href="cairo-Paths.html#cairo-glyph-path" title="cairo_glyph_path ()">cairo_glyph_path</a> <span class="c_punctuation">()</span>
168 </td>
169 </tr>
170 <tr>
171 <td class="function_type">
172 <span class="returnvalue">void</span>
173 </td>
174 <td class="function_name">
175 <a class="link" href="cairo-Paths.html#cairo-text-path" title="cairo_text_path ()">cairo_text_path</a> <span class="c_punctuation">()</span>
176 </td>
177 </tr>
178 <tr>
179 <td class="function_type">
180 <span class="returnvalue">void</span>
181 </td>
182 <td class="function_name">
183 <a class="link" href="cairo-Paths.html#cairo-rel-curve-to" title="cairo_rel_curve_to ()">cairo_rel_curve_to</a> <span class="c_punctuation">()</span>
184 </td>
185 </tr>
186 <tr>
187 <td class="function_type">
188 <span class="returnvalue">void</span>
189 </td>
190 <td class="function_name">
191 <a class="link" href="cairo-Paths.html#cairo-rel-line-to" title="cairo_rel_line_to ()">cairo_rel_line_to</a> <span class="c_punctuation">()</span>
192 </td>
193 </tr>
194 <tr>
195 <td class="function_type">
196 <span class="returnvalue">void</span>
197 </td>
198 <td class="function_name">
199 <a class="link" href="cairo-Paths.html#cairo-rel-move-to" title="cairo_rel_move_to ()">cairo_rel_move_to</a> <span class="c_punctuation">()</span>
200 </td>
201 </tr>
202 <tr>
203 <td class="function_type">
204 <span class="returnvalue">void</span>
205 </td>
206 <td class="function_name">
207 <a class="link" href="cairo-Paths.html#cairo-path-extents" title="cairo_path_extents ()">cairo_path_extents</a> <span class="c_punctuation">()</span>
208 </td>
209 </tr>
210 </tbody>
211 </table></div>
212 </div>
213 <div class="refsect1">
214 <a name="cairo-Paths.other"></a><h2>Types and Values</h2>
215 <div class="informaltable"><table class="informaltable" width="100%" border="0">
216 <colgroup>
217 <col width="150px" class="name">
218 <col class="description">
219 </colgroup>
220 <tbody>
221 <tr>
222 <td class="datatype_keyword"> </td>
223 <td class="function_name"><a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t">cairo_path_t</a></td>
224 </tr>
225 <tr>
226 <td class="datatype_keyword">union</td>
227 <td class="function_name"><a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t">cairo_path_data_t</a></td>
228 </tr>
229 <tr>
230 <td class="datatype_keyword">enum</td>
231 <td class="function_name"><a class="link" href="cairo-Paths.html#cairo-path-data-type-t" title="enum cairo_path_data_type_t">cairo_path_data_type_t</a></td>
232 </tr>
233 </tbody>
234 </table></div>
235 </div>
236 <div class="refsect1">
237 <a name="cairo-Paths.description"></a><h2>Description</h2>
238 <p>Paths are the most basic drawing tools and are primarily used to implicitly
239 generate simple masks.</p>
240 </div>
241 <div class="refsect1">
242 <a name="cairo-Paths.functions_details"></a><h2>Functions</h2>
243 <div class="refsect2">
244 <a name="cairo-copy-path"></a><h3>cairo_copy_path ()</h3>
245 <pre class="programlisting"><a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="returnvalue">cairo_path_t</span></a> *
246 cairo_copy_path (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
247 <p>Creates a copy of the current path and returns it to the user as a
248 <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a>. See <a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a> for hints on how to iterate
249 over the returned data structure.</p>
250 <p>This function will always return a valid pointer, but the result
251 will have no data (<code class="literal">data==<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></code> and
252 <code class="literal">num_data==0</code>), if either of the following
253 conditions hold:</p>
254 <div class="orderedlist"><ol class="orderedlist" type="1">
255 <li class="listitem">If there is insufficient memory to copy the path. In this
256 case <code class="literal">path-&gt;status</code> will be set to
257 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a>.</li>
258 <li class="listitem">If <em class="parameter"><code>cr</code></em> is already in an error state. In this case
259 <code class="literal">path-&gt;status</code> will contain the same status that
260 would be returned by <a class="link" href="cairo-cairo-t.html#cairo-status" title="cairo_status ()"><code class="function">cairo_status()</code></a>.</li>
261 </ol></div>
262 <div class="refsect3">
263 <a name="cairo-copy-path.parameters"></a><h4>Parameters</h4>
264 <div class="informaltable"><table class="informaltable" width="100%" border="0">
265 <colgroup>
266 <col width="150px" class="parameters_name">
267 <col class="parameters_description">
268 <col width="200px" class="parameters_annotations">
269 </colgroup>
270 <tbody><tr>
271 <td class="parameter_name"><p>cr</p></td>
272 <td class="parameter_description"><p>a cairo context</p></td>
273 <td class="parameter_annotations"> </td>
274 </tr></tbody>
275 </table></div>
276 </div>
277 <div class="refsect3">
278 <a name="cairo-copy-path.returns"></a><h4>Returns</h4>
279 <p> the copy of the current path. The caller owns the
280 returned object and should call <a class="link" href="cairo-Paths.html#cairo-path-destroy" title="cairo_path_destroy ()"><code class="function">cairo_path_destroy()</code></a> when finished
281 with it.</p>
282 </div>
283 <p class="since">Since: 1.0</p>
284 </div>
285 <hr>
286 <div class="refsect2">
287 <a name="cairo-copy-path-flat"></a><h3>cairo_copy_path_flat ()</h3>
288 <pre class="programlisting"><a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="returnvalue">cairo_path_t</span></a> *
289 cairo_copy_path_flat (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
290 <p>Gets a flattened copy of the current path and returns it to the
291 user as a <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a>. See <a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a> for hints on
292 how to iterate over the returned data structure.</p>
293 <p>This function is like <a class="link" href="cairo-Paths.html#cairo-copy-path" title="cairo_copy_path ()"><code class="function">cairo_copy_path()</code></a> except that any curves
294 in the path will be approximated with piecewise-linear
295 approximations, (accurate to within the current tolerance
296 value). That is, the result is guaranteed to not have any elements
297 of type <a class="link" href="cairo-Paths.html#CAIRO-PATH-CURVE-TO:CAPS"><code class="literal">CAIRO_PATH_CURVE_TO</code></a> which will instead be replaced by a
298 series of <a class="link" href="cairo-Paths.html#CAIRO-PATH-LINE-TO:CAPS"><code class="literal">CAIRO_PATH_LINE_TO</code></a> elements.</p>
299 <p>This function will always return a valid pointer, but the result
300 will have no data (<code class="literal">data==<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></code> and
301 <code class="literal">num_data==0</code>), if either of the following
302 conditions hold:</p>
303 <div class="orderedlist"><ol class="orderedlist" type="1">
304 <li class="listitem">If there is insufficient memory to copy the path. In this
305 case <code class="literal">path-&gt;status</code> will be set to
306 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a>.</li>
307 <li class="listitem">If <em class="parameter"><code>cr</code></em> is already in an error state. In this case
308 <code class="literal">path-&gt;status</code> will contain the same status that
309 would be returned by <a class="link" href="cairo-cairo-t.html#cairo-status" title="cairo_status ()"><code class="function">cairo_status()</code></a>.</li>
310 </ol></div>
311 <div class="refsect3">
312 <a name="cairo-copy-path-flat.parameters"></a><h4>Parameters</h4>
313 <div class="informaltable"><table class="informaltable" width="100%" border="0">
314 <colgroup>
315 <col width="150px" class="parameters_name">
316 <col class="parameters_description">
317 <col width="200px" class="parameters_annotations">
318 </colgroup>
319 <tbody><tr>
320 <td class="parameter_name"><p>cr</p></td>
321 <td class="parameter_description"><p>a cairo context</p></td>
322 <td class="parameter_annotations"> </td>
323 </tr></tbody>
324 </table></div>
325 </div>
326 <div class="refsect3">
327 <a name="cairo-copy-path-flat.returns"></a><h4>Returns</h4>
328 <p> the copy of the current path. The caller owns the
329 returned object and should call <a class="link" href="cairo-Paths.html#cairo-path-destroy" title="cairo_path_destroy ()"><code class="function">cairo_path_destroy()</code></a> when finished
330 with it.</p>
331 </div>
332 <p class="since">Since: 1.0</p>
333 </div>
334 <hr>
335 <div class="refsect2">
336 <a name="cairo-path-destroy"></a><h3>cairo_path_destroy ()</h3>
337 <pre class="programlisting"><span class="returnvalue">void</span>
338 cairo_path_destroy (<em class="parameter"><code><a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a> *path</code></em>);</pre>
339 <p>Immediately releases all memory associated with <em class="parameter"><code>path</code></em>
340 . After a call
341 to <a class="link" href="cairo-Paths.html#cairo-path-destroy" title="cairo_path_destroy ()"><code class="function">cairo_path_destroy()</code></a> the <em class="parameter"><code>path</code></em>
342 pointer is no longer valid and
343 should not be used further.</p>
344 <p>Note: <a class="link" href="cairo-Paths.html#cairo-path-destroy" title="cairo_path_destroy ()"><code class="function">cairo_path_destroy()</code></a> should only be called with a
345 pointer to a <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a> returned by a cairo function. Any path
346 that is created manually (ie. outside of cairo) should be destroyed
347 manually as well.</p>
348 <div class="refsect3">
349 <a name="cairo-path-destroy.parameters"></a><h4>Parameters</h4>
350 <div class="informaltable"><table class="informaltable" width="100%" border="0">
351 <colgroup>
352 <col width="150px" class="parameters_name">
353 <col class="parameters_description">
354 <col width="200px" class="parameters_annotations">
355 </colgroup>
356 <tbody><tr>
357 <td class="parameter_name"><p>path</p></td>
358 <td class="parameter_description"><p>a path previously returned by either <a class="link" href="cairo-Paths.html#cairo-copy-path" title="cairo_copy_path ()"><code class="function">cairo_copy_path()</code></a> or
359 <a class="link" href="cairo-Paths.html#cairo-copy-path-flat" title="cairo_copy_path_flat ()"><code class="function">cairo_copy_path_flat()</code></a>.</p></td>
360 <td class="parameter_annotations"> </td>
361 </tr></tbody>
362 </table></div>
363 </div>
364 <p class="since">Since: 1.0</p>
365 </div>
366 <hr>
367 <div class="refsect2">
368 <a name="cairo-append-path"></a><h3>cairo_append_path ()</h3>
369 <pre class="programlisting"><span class="returnvalue">void</span>
370 cairo_append_path (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
371 <em class="parameter"><code>const <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a> *path</code></em>);</pre>
372 <p>Append the <em class="parameter"><code>path</code></em>
373 onto the current path. The <em class="parameter"><code>path</code></em>
374 may be either the
375 return value from one of <a class="link" href="cairo-Paths.html#cairo-copy-path" title="cairo_copy_path ()"><code class="function">cairo_copy_path()</code></a> or
376 <a class="link" href="cairo-Paths.html#cairo-copy-path-flat" title="cairo_copy_path_flat ()"><code class="function">cairo_copy_path_flat()</code></a> or it may be constructed manually. See
377 <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a> for details on how the path data structure should be
378 initialized, and note that <code class="literal">path-&gt;status</code> must be
379 initialized to <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>.</p>
380 <div class="refsect3">
381 <a name="cairo-append-path.parameters"></a><h4>Parameters</h4>
382 <div class="informaltable"><table class="informaltable" width="100%" border="0">
383 <colgroup>
384 <col width="150px" class="parameters_name">
385 <col class="parameters_description">
386 <col width="200px" class="parameters_annotations">
387 </colgroup>
388 <tbody>
389 <tr>
390 <td class="parameter_name"><p>cr</p></td>
391 <td class="parameter_description"><p>a cairo context</p></td>
392 <td class="parameter_annotations"> </td>
393 </tr>
394 <tr>
395 <td class="parameter_name"><p>path</p></td>
396 <td class="parameter_description"><p>path to be appended</p></td>
397 <td class="parameter_annotations"> </td>
398 </tr>
399 </tbody>
400 </table></div>
401 </div>
402 <p class="since">Since: 1.0</p>
403 </div>
404 <hr>
405 <div class="refsect2">
406 <a name="cairo-has-current-point"></a><h3>cairo_has_current_point ()</h3>
407 <pre class="programlisting"><a class="link" href="cairo-Types.html#cairo-bool-t" title="cairo_bool_t"><span class="returnvalue">cairo_bool_t</span></a>
408 cairo_has_current_point (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
409 <p>Returns whether a current point is defined on the current path.
410 See <a class="link" href="cairo-Paths.html#cairo-get-current-point" title="cairo_get_current_point ()"><code class="function">cairo_get_current_point()</code></a> for details on the current point.</p>
411 <div class="refsect3">
412 <a name="cairo-has-current-point.parameters"></a><h4>Parameters</h4>
413 <div class="informaltable"><table class="informaltable" width="100%" border="0">
414 <colgroup>
415 <col width="150px" class="parameters_name">
416 <col class="parameters_description">
417 <col width="200px" class="parameters_annotations">
418 </colgroup>
419 <tbody><tr>
420 <td class="parameter_name"><p>cr</p></td>
421 <td class="parameter_description"><p>a cairo context</p></td>
422 <td class="parameter_annotations"> </td>
423 </tr></tbody>
424 </table></div>
425 </div>
426 <div class="refsect3">
427 <a name="cairo-has-current-point.returns"></a><h4>Returns</h4>
428 <p> whether a current point is defined.</p>
429 </div>
430 <p class="since">Since: 1.6</p>
431 </div>
432 <hr>
433 <div class="refsect2">
434 <a name="cairo-get-current-point"></a><h3>cairo_get_current_point ()</h3>
435 <pre class="programlisting"><span class="returnvalue">void</span>
436 cairo_get_current_point (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
437 <em class="parameter"><code><span class="type">double</span> *x</code></em>,
438 <em class="parameter"><code><span class="type">double</span> *y</code></em>);</pre>
439 <p>Gets the current point of the current path, which is
440 conceptually the final point reached by the path so far.</p>
441 <p>The current point is returned in the user-space coordinate
442 system. If there is no defined current point or if <em class="parameter"><code>cr</code></em>
443 is in an
444 error status, <em class="parameter"><code>x</code></em>
445 and <em class="parameter"><code>y</code></em>
446 will both be set to 0.0. It is possible to
447 check this in advance with <a class="link" href="cairo-Paths.html#cairo-has-current-point" title="cairo_has_current_point ()"><code class="function">cairo_has_current_point()</code></a>.</p>
448 <p>Most path construction functions alter the current point. See the
449 following for details on how they affect the current point:
450 <a class="link" href="cairo-Paths.html#cairo-new-path" title="cairo_new_path ()"><code class="function">cairo_new_path()</code></a>, <a class="link" href="cairo-Paths.html#cairo-new-sub-path" title="cairo_new_sub_path ()"><code class="function">cairo_new_sub_path()</code></a>,
451 <a class="link" href="cairo-Paths.html#cairo-append-path" title="cairo_append_path ()"><code class="function">cairo_append_path()</code></a>, <a class="link" href="cairo-Paths.html#cairo-close-path" title="cairo_close_path ()"><code class="function">cairo_close_path()</code></a>,
452 <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()"><code class="function">cairo_move_to()</code></a>, <a class="link" href="cairo-Paths.html#cairo-line-to" title="cairo_line_to ()"><code class="function">cairo_line_to()</code></a>, <a class="link" href="cairo-Paths.html#cairo-curve-to" title="cairo_curve_to ()"><code class="function">cairo_curve_to()</code></a>,
453 <a class="link" href="cairo-Paths.html#cairo-rel-move-to" title="cairo_rel_move_to ()"><code class="function">cairo_rel_move_to()</code></a>, <a class="link" href="cairo-Paths.html#cairo-rel-line-to" title="cairo_rel_line_to ()"><code class="function">cairo_rel_line_to()</code></a>, <a class="link" href="cairo-Paths.html#cairo-rel-curve-to" title="cairo_rel_curve_to ()"><code class="function">cairo_rel_curve_to()</code></a>,
454 <a class="link" href="cairo-Paths.html#cairo-arc" title="cairo_arc ()"><code class="function">cairo_arc()</code></a>, <a class="link" href="cairo-Paths.html#cairo-arc-negative" title="cairo_arc_negative ()"><code class="function">cairo_arc_negative()</code></a>, <a class="link" href="cairo-Paths.html#cairo-rectangle" title="cairo_rectangle ()"><code class="function">cairo_rectangle()</code></a>,
455 <a class="link" href="cairo-Paths.html#cairo-text-path" title="cairo_text_path ()"><code class="function">cairo_text_path()</code></a>, <a class="link" href="cairo-Paths.html#cairo-glyph-path" title="cairo_glyph_path ()"><code class="function">cairo_glyph_path()</code></a>, <code class="function">cairo_stroke_to_path()</code>.</p>
456 <p>Some functions use and alter the current point but do not
457 otherwise change current path:
458 <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a>.</p>
459 <p>Some functions unset the current path and as a result, current point:
460 <a class="link" href="cairo-cairo-t.html#cairo-fill" title="cairo_fill ()"><code class="function">cairo_fill()</code></a>, <a class="link" href="cairo-cairo-t.html#cairo-stroke" title="cairo_stroke ()"><code class="function">cairo_stroke()</code></a>.</p>
461 <div class="refsect3">
462 <a name="cairo-get-current-point.parameters"></a><h4>Parameters</h4>
463 <div class="informaltable"><table class="informaltable" width="100%" border="0">
464 <colgroup>
465 <col width="150px" class="parameters_name">
466 <col class="parameters_description">
467 <col width="200px" class="parameters_annotations">
468 </colgroup>
469 <tbody>
470 <tr>
471 <td class="parameter_name"><p>cr</p></td>
472 <td class="parameter_description"><p>a cairo context</p></td>
473 <td class="parameter_annotations"> </td>
474 </tr>
475 <tr>
476 <td class="parameter_name"><p>x</p></td>
477 <td class="parameter_description"><p>return value for X coordinate of the current point</p></td>
478 <td class="parameter_annotations"> </td>
479 </tr>
480 <tr>
481 <td class="parameter_name"><p>y</p></td>
482 <td class="parameter_description"><p>return value for Y coordinate of the current point</p></td>
483 <td class="parameter_annotations"> </td>
484 </tr>
485 </tbody>
486 </table></div>
487 </div>
488 <p class="since">Since: 1.0</p>
489 </div>
490 <hr>
491 <div class="refsect2">
492 <a name="cairo-new-path"></a><h3>cairo_new_path ()</h3>
493 <pre class="programlisting"><span class="returnvalue">void</span>
494 cairo_new_path (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
495 <p>Clears the current path. After this call there will be no path and
496 no current point.</p>
497 <div class="refsect3">
498 <a name="cairo-new-path.parameters"></a><h4>Parameters</h4>
499 <div class="informaltable"><table class="informaltable" width="100%" border="0">
500 <colgroup>
501 <col width="150px" class="parameters_name">
502 <col class="parameters_description">
503 <col width="200px" class="parameters_annotations">
504 </colgroup>
505 <tbody><tr>
506 <td class="parameter_name"><p>cr</p></td>
507 <td class="parameter_description"><p>a cairo context</p></td>
508 <td class="parameter_annotations"> </td>
509 </tr></tbody>
510 </table></div>
511 </div>
512 <p class="since">Since: 1.0</p>
513 </div>
514 <hr>
515 <div class="refsect2">
516 <a name="cairo-new-sub-path"></a><h3>cairo_new_sub_path ()</h3>
517 <pre class="programlisting"><span class="returnvalue">void</span>
518 cairo_new_sub_path (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
519 <p>Begin a new sub-path. Note that the existing path is not
520 affected. After this call there will be no current point.</p>
521 <p>In many cases, this call is not needed since new sub-paths are
522 frequently started with <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()"><code class="function">cairo_move_to()</code></a>.</p>
523 <p>A call to <a class="link" href="cairo-Paths.html#cairo-new-sub-path" title="cairo_new_sub_path ()"><code class="function">cairo_new_sub_path()</code></a> is particularly useful when
524 beginning a new sub-path with one of the <a class="link" href="cairo-Paths.html#cairo-arc" title="cairo_arc ()"><code class="function">cairo_arc()</code></a> calls. This
525 makes things easier as it is no longer necessary to manually
526 compute the arc's initial coordinates for a call to
527 <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()"><code class="function">cairo_move_to()</code></a>.</p>
528 <div class="refsect3">
529 <a name="cairo-new-sub-path.parameters"></a><h4>Parameters</h4>
530 <div class="informaltable"><table class="informaltable" width="100%" border="0">
531 <colgroup>
532 <col width="150px" class="parameters_name">
533 <col class="parameters_description">
534 <col width="200px" class="parameters_annotations">
535 </colgroup>
536 <tbody><tr>
537 <td class="parameter_name"><p>cr</p></td>
538 <td class="parameter_description"><p>a cairo context</p></td>
539 <td class="parameter_annotations"> </td>
540 </tr></tbody>
541 </table></div>
542 </div>
543 <p class="since">Since: 1.2</p>
544 </div>
545 <hr>
546 <div class="refsect2">
547 <a name="cairo-close-path"></a><h3>cairo_close_path ()</h3>
548 <pre class="programlisting"><span class="returnvalue">void</span>
549 cairo_close_path (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
550 <p>Adds a line segment to the path from the current point to the
551 beginning of the current sub-path, (the most recent point passed to
552 <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()"><code class="function">cairo_move_to()</code></a>), and closes this sub-path. After this call the
553 current point will be at the joined endpoint of the sub-path.</p>
554 <p>The behavior of <a class="link" href="cairo-Paths.html#cairo-close-path" title="cairo_close_path ()"><code class="function">cairo_close_path()</code></a> is distinct from simply calling
555 <a class="link" href="cairo-Paths.html#cairo-line-to" title="cairo_line_to ()"><code class="function">cairo_line_to()</code></a> with the equivalent coordinate in the case of
556 stroking. When a closed sub-path is stroked, there are no caps on
557 the ends of the sub-path. Instead, there is a line join connecting
558 the final and initial segments of the sub-path.</p>
559 <p>If there is no current point before the call to <a class="link" href="cairo-Paths.html#cairo-close-path" title="cairo_close_path ()"><code class="function">cairo_close_path()</code></a>,
560 this function will have no effect.</p>
561 <p>Note: As of cairo version 1.2.4 any call to <a class="link" href="cairo-Paths.html#cairo-close-path" title="cairo_close_path ()"><code class="function">cairo_close_path()</code></a> will
562 place an explicit MOVE_TO element into the path immediately after
563 the CLOSE_PATH element, (which can be seen in <a class="link" href="cairo-Paths.html#cairo-copy-path" title="cairo_copy_path ()"><code class="function">cairo_copy_path()</code></a> for
564 example). This can simplify path processing in some cases as it may
565 not be necessary to save the "last move_to point" during processing
566 as the MOVE_TO immediately after the CLOSE_PATH will provide that
567 point.</p>
568 <div class="refsect3">
569 <a name="cairo-close-path.parameters"></a><h4>Parameters</h4>
570 <div class="informaltable"><table class="informaltable" width="100%" border="0">
571 <colgroup>
572 <col width="150px" class="parameters_name">
573 <col class="parameters_description">
574 <col width="200px" class="parameters_annotations">
575 </colgroup>
576 <tbody><tr>
577 <td class="parameter_name"><p>cr</p></td>
578 <td class="parameter_description"><p>a cairo context</p></td>
579 <td class="parameter_annotations"> </td>
580 </tr></tbody>
581 </table></div>
582 </div>
583 <p class="since">Since: 1.0</p>
584 </div>
585 <hr>
586 <div class="refsect2">
587 <a name="cairo-arc"></a><h3>cairo_arc ()</h3>
588 <pre class="programlisting"><span class="returnvalue">void</span>
589 cairo_arc (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
590 <em class="parameter"><code><span class="type">double</span> xc</code></em>,
591 <em class="parameter"><code><span class="type">double</span> yc</code></em>,
592 <em class="parameter"><code><span class="type">double</span> radius</code></em>,
593 <em class="parameter"><code><span class="type">double</span> angle1</code></em>,
594 <em class="parameter"><code><span class="type">double</span> angle2</code></em>);</pre>
595 <p>Adds a circular arc of the given <em class="parameter"><code>radius</code></em>
596 to the current path. The
597 arc is centered at (<em class="parameter"><code>xc</code></em>
598 , <em class="parameter"><code>yc</code></em>
599 ), begins at <em class="parameter"><code>angle1</code></em>
600 and proceeds in
601 the direction of increasing angles to end at <em class="parameter"><code>angle2</code></em>
602 . If <em class="parameter"><code>angle2</code></em>
603 is
604 less than <em class="parameter"><code>angle1</code></em>
605 it will be progressively increased by
606 <code class="literal">2*M_PI</code> until it is greater than <em class="parameter"><code>angle1</code></em>
607 .</p>
608 <p>If there is a current point, an initial line segment will be added
609 to the path to connect the current point to the beginning of the
610 arc. If this initial line is undesired, it can be avoided by
611 calling <a class="link" href="cairo-Paths.html#cairo-new-sub-path" title="cairo_new_sub_path ()"><code class="function">cairo_new_sub_path()</code></a> before calling <a class="link" href="cairo-Paths.html#cairo-arc" title="cairo_arc ()"><code class="function">cairo_arc()</code></a>.</p>
612 <p>Angles are measured in radians. An angle of 0.0 is in the direction
613 of the positive X axis (in user space). An angle of
614 <code class="literal">M_PI/2.0</code> radians (90 degrees) is in the
615 direction of the positive Y axis (in user space). Angles increase
616 in the direction from the positive X axis toward the positive Y
617 axis. So with the default transformation matrix, angles increase in
618 a clockwise direction.</p>
619 <p>(To convert from degrees to radians, use <code class="literal">degrees * (M_PI /
620 180.)</code>.)</p>
621 <p>This function gives the arc in the direction of increasing angles;
622 see <a class="link" href="cairo-Paths.html#cairo-arc-negative" title="cairo_arc_negative ()"><code class="function">cairo_arc_negative()</code></a> to get the arc in the direction of
623 decreasing angles.</p>
624 <p>The arc is circular in user space. To achieve an elliptical arc,
625 you can scale the current transformation matrix by different
626 amounts in the X and Y directions. For example, to draw an ellipse
627 in the box given by <em class="parameter"><code>x</code></em>
628 , <em class="parameter"><code>y</code></em>
629 , <em class="parameter"><code>width</code></em>
630 , <em class="parameter"><code>height</code></em>
631 :</p>
632 <div class="informalexample">
633 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
634 <tbody>
635 <tr>
636 <td class="listing_lines" align="right"><pre>1
637 2
638 3
639 4
640 5</pre></td>
641 <td class="listing_code"><pre class="programlisting"><span class="function"><a href="cairo-cairo-t.html#cairo-save">cairo_save</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span>
642 <span class="function"><a href="cairo-Transformations.html#cairo-translate">cairo_translate</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> x <span class="gtkdoc opt">+</span> width <span class="gtkdoc opt">/</span> <span class="number">2</span><span class="gtkdoc opt">.,</span> y <span class="gtkdoc opt">+</span> height <span class="gtkdoc opt">/</span> <span class="number">2</span><span class="gtkdoc opt">.);</span>
643 <span class="function"><a href="cairo-Transformations.html#cairo-scale">cairo_scale</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> width <span class="gtkdoc opt">/</span> <span class="number">2</span><span class="gtkdoc opt">.,</span> height <span class="gtkdoc opt">/</span> <span class="number">2</span><span class="gtkdoc opt">.);</span>
644 <span class="function"><a href="cairo-Paths.html#cairo-arc">cairo_arc</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">.,</span> <span class="number">0</span><span class="gtkdoc opt">.,</span> <span class="number">1</span><span class="gtkdoc opt">.,</span> <span class="number">0</span><span class="gtkdoc opt">.,</span> <span class="number">2</span> <span class="gtkdoc opt">*</span> M_PI<span class="gtkdoc opt">);</span>
645 <span class="function"><a href="cairo-cairo-t.html#cairo-restore">cairo_restore</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span></pre></td>
646 </tr>
647 </tbody>
648 </table>
649 </div>
650
651 <div class="refsect3">
652 <a name="cairo-arc.parameters"></a><h4>Parameters</h4>
653 <div class="informaltable"><table class="informaltable" width="100%" border="0">
654 <colgroup>
655 <col width="150px" class="parameters_name">
656 <col class="parameters_description">
657 <col width="200px" class="parameters_annotations">
658 </colgroup>
659 <tbody>
660 <tr>
661 <td class="parameter_name"><p>cr</p></td>
662 <td class="parameter_description"><p>a cairo context</p></td>
663 <td class="parameter_annotations"> </td>
664 </tr>
665 <tr>
666 <td class="parameter_name"><p>xc</p></td>
667 <td class="parameter_description"><p>X position of the center of the arc</p></td>
668 <td class="parameter_annotations"> </td>
669 </tr>
670 <tr>
671 <td class="parameter_name"><p>yc</p></td>
672 <td class="parameter_description"><p>Y position of the center of the arc</p></td>
673 <td class="parameter_annotations"> </td>
674 </tr>
675 <tr>
676 <td class="parameter_name"><p>radius</p></td>
677 <td class="parameter_description"><p>the radius of the arc</p></td>
678 <td class="parameter_annotations"> </td>
679 </tr>
680 <tr>
681 <td class="parameter_name"><p>angle1</p></td>
682 <td class="parameter_description"><p>the start angle, in radians</p></td>
683 <td class="parameter_annotations"> </td>
684 </tr>
685 <tr>
686 <td class="parameter_name"><p>angle2</p></td>
687 <td class="parameter_description"><p>the end angle, in radians</p></td>
688 <td class="parameter_annotations"> </td>
689 </tr>
690 </tbody>
691 </table></div>
692 </div>
693 <p class="since">Since: 1.0</p>
694 </div>
695 <hr>
696 <div class="refsect2">
697 <a name="cairo-arc-negative"></a><h3>cairo_arc_negative ()</h3>
698 <pre class="programlisting"><span class="returnvalue">void</span>
699 cairo_arc_negative (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
700 <em class="parameter"><code><span class="type">double</span> xc</code></em>,
701 <em class="parameter"><code><span class="type">double</span> yc</code></em>,
702 <em class="parameter"><code><span class="type">double</span> radius</code></em>,
703 <em class="parameter"><code><span class="type">double</span> angle1</code></em>,
704 <em class="parameter"><code><span class="type">double</span> angle2</code></em>);</pre>
705 <p>Adds a circular arc of the given <em class="parameter"><code>radius</code></em>
706 to the current path. The
707 arc is centered at (<em class="parameter"><code>xc</code></em>
708 , <em class="parameter"><code>yc</code></em>
709 ), begins at <em class="parameter"><code>angle1</code></em>
710 and proceeds in
711 the direction of decreasing angles to end at <em class="parameter"><code>angle2</code></em>
712 . If <em class="parameter"><code>angle2</code></em>
713 is
714 greater than <em class="parameter"><code>angle1</code></em>
715 it will be progressively decreased by
716 <code class="literal">2*M_PI</code> until it is less than <em class="parameter"><code>angle1</code></em>
717 .</p>
718 <p>See <a class="link" href="cairo-Paths.html#cairo-arc" title="cairo_arc ()"><code class="function">cairo_arc()</code></a> for more details. This function differs only in the
719 direction of the arc between the two angles.</p>
720 <div class="refsect3">
721 <a name="cairo-arc-negative.parameters"></a><h4>Parameters</h4>
722 <div class="informaltable"><table class="informaltable" width="100%" border="0">
723 <colgroup>
724 <col width="150px" class="parameters_name">
725 <col class="parameters_description">
726 <col width="200px" class="parameters_annotations">
727 </colgroup>
728 <tbody>
729 <tr>
730 <td class="parameter_name"><p>cr</p></td>
731 <td class="parameter_description"><p>a cairo context</p></td>
732 <td class="parameter_annotations"> </td>
733 </tr>
734 <tr>
735 <td class="parameter_name"><p>xc</p></td>
736 <td class="parameter_description"><p>X position of the center of the arc</p></td>
737 <td class="parameter_annotations"> </td>
738 </tr>
739 <tr>
740 <td class="parameter_name"><p>yc</p></td>
741 <td class="parameter_description"><p>Y position of the center of the arc</p></td>
742 <td class="parameter_annotations"> </td>
743 </tr>
744 <tr>
745 <td class="parameter_name"><p>radius</p></td>
746 <td class="parameter_description"><p>the radius of the arc</p></td>
747 <td class="parameter_annotations"> </td>
748 </tr>
749 <tr>
750 <td class="parameter_name"><p>angle1</p></td>
751 <td class="parameter_description"><p>the start angle, in radians</p></td>
752 <td class="parameter_annotations"> </td>
753 </tr>
754 <tr>
755 <td class="parameter_name"><p>angle2</p></td>
756 <td class="parameter_description"><p>the end angle, in radians</p></td>
757 <td class="parameter_annotations"> </td>
758 </tr>
759 </tbody>
760 </table></div>
761 </div>
762 <p class="since">Since: 1.0</p>
763 </div>
764 <hr>
765 <div class="refsect2">
766 <a name="cairo-curve-to"></a><h3>cairo_curve_to ()</h3>
767 <pre class="programlisting"><span class="returnvalue">void</span>
768 cairo_curve_to (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
769 <em class="parameter"><code><span class="type">double</span> x1</code></em>,
770 <em class="parameter"><code><span class="type">double</span> y1</code></em>,
771 <em class="parameter"><code><span class="type">double</span> x2</code></em>,
772 <em class="parameter"><code><span class="type">double</span> y2</code></em>,
773 <em class="parameter"><code><span class="type">double</span> x3</code></em>,
774 <em class="parameter"><code><span class="type">double</span> y3</code></em>);</pre>
775 <p>Adds a cubic Bézier spline to the path from the current point to
776 position (<em class="parameter"><code>x3</code></em>
777 , <em class="parameter"><code>y3</code></em>
778 ) in user-space coordinates, using (<em class="parameter"><code>x1</code></em>
779 , <em class="parameter"><code>y1</code></em>
780 ) and
781 (<em class="parameter"><code>x2</code></em>
782 , <em class="parameter"><code>y2</code></em>
783 ) as the control points. After this call the current point
784 will be (<em class="parameter"><code>x3</code></em>
785 , <em class="parameter"><code>y3</code></em>
786 ).</p>
787 <p>If there is no current point before the call to <a class="link" href="cairo-Paths.html#cairo-curve-to" title="cairo_curve_to ()"><code class="function">cairo_curve_to()</code></a>
788 this function will behave as if preceded by a call to
789 cairo_move_to(<em class="parameter"><code>cr</code></em>
790 , <em class="parameter"><code>x1</code></em>
791 , <em class="parameter"><code>y1</code></em>
792 ).</p>
793 <div class="refsect3">
794 <a name="cairo-curve-to.parameters"></a><h4>Parameters</h4>
795 <div class="informaltable"><table class="informaltable" width="100%" border="0">
796 <colgroup>
797 <col width="150px" class="parameters_name">
798 <col class="parameters_description">
799 <col width="200px" class="parameters_annotations">
800 </colgroup>
801 <tbody>
802 <tr>
803 <td class="parameter_name"><p>cr</p></td>
804 <td class="parameter_description"><p>a cairo context</p></td>
805 <td class="parameter_annotations"> </td>
806 </tr>
807 <tr>
808 <td class="parameter_name"><p>x1</p></td>
809 <td class="parameter_description"><p>the X coordinate of the first control point</p></td>
810 <td class="parameter_annotations"> </td>
811 </tr>
812 <tr>
813 <td class="parameter_name"><p>y1</p></td>
814 <td class="parameter_description"><p>the Y coordinate of the first control point</p></td>
815 <td class="parameter_annotations"> </td>
816 </tr>
817 <tr>
818 <td class="parameter_name"><p>x2</p></td>
819 <td class="parameter_description"><p>the X coordinate of the second control point</p></td>
820 <td class="parameter_annotations"> </td>
821 </tr>
822 <tr>
823 <td class="parameter_name"><p>y2</p></td>
824 <td class="parameter_description"><p>the Y coordinate of the second control point</p></td>
825 <td class="parameter_annotations"> </td>
826 </tr>
827 <tr>
828 <td class="parameter_name"><p>x3</p></td>
829 <td class="parameter_description"><p>the X coordinate of the end of the curve</p></td>
830 <td class="parameter_annotations"> </td>
831 </tr>
832 <tr>
833 <td class="parameter_name"><p>y3</p></td>
834 <td class="parameter_description"><p>the Y coordinate of the end of the curve</p></td>
835 <td class="parameter_annotations"> </td>
836 </tr>
837 </tbody>
838 </table></div>
839 </div>
840 <p class="since">Since: 1.0</p>
841 </div>
842 <hr>
843 <div class="refsect2">
844 <a name="cairo-line-to"></a><h3>cairo_line_to ()</h3>
845 <pre class="programlisting"><span class="returnvalue">void</span>
846 cairo_line_to (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
847 <em class="parameter"><code><span class="type">double</span> x</code></em>,
848 <em class="parameter"><code><span class="type">double</span> y</code></em>);</pre>
849 <p>Adds a line to the path from the current point to position (<em class="parameter"><code>x</code></em>
850 , <em class="parameter"><code>y</code></em>
851 )
852 in user-space coordinates. After this call the current point
853 will be (<em class="parameter"><code>x</code></em>
854 , <em class="parameter"><code>y</code></em>
855 ).</p>
856 <p>If there is no current point before the call to <a class="link" href="cairo-Paths.html#cairo-line-to" title="cairo_line_to ()"><code class="function">cairo_line_to()</code></a>
857 this function will behave as cairo_move_to(<em class="parameter"><code>cr</code></em>
858 , <em class="parameter"><code>x</code></em>
859 , <em class="parameter"><code>y</code></em>
860 ).</p>
861 <div class="refsect3">
862 <a name="cairo-line-to.parameters"></a><h4>Parameters</h4>
863 <div class="informaltable"><table class="informaltable" width="100%" border="0">
864 <colgroup>
865 <col width="150px" class="parameters_name">
866 <col class="parameters_description">
867 <col width="200px" class="parameters_annotations">
868 </colgroup>
869 <tbody>
870 <tr>
871 <td class="parameter_name"><p>cr</p></td>
872 <td class="parameter_description"><p>a cairo context</p></td>
873 <td class="parameter_annotations"> </td>
874 </tr>
875 <tr>
876 <td class="parameter_name"><p>x</p></td>
877 <td class="parameter_description"><p>the X coordinate of the end of the new line</p></td>
878 <td class="parameter_annotations"> </td>
879 </tr>
880 <tr>
881 <td class="parameter_name"><p>y</p></td>
882 <td class="parameter_description"><p>the Y coordinate of the end of the new line</p></td>
883 <td class="parameter_annotations"> </td>
884 </tr>
885 </tbody>
886 </table></div>
887 </div>
888 <p class="since">Since: 1.0</p>
889 </div>
890 <hr>
891 <div class="refsect2">
892 <a name="cairo-move-to"></a><h3>cairo_move_to ()</h3>
893 <pre class="programlisting"><span class="returnvalue">void</span>
894 cairo_move_to (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
895 <em class="parameter"><code><span class="type">double</span> x</code></em>,
896 <em class="parameter"><code><span class="type">double</span> y</code></em>);</pre>
897 <p>Begin a new sub-path. After this call the current point will be (<em class="parameter"><code>x</code></em>
898 ,
899 <em class="parameter"><code>y</code></em>
900 ).</p>
901 <div class="refsect3">
902 <a name="cairo-move-to.parameters"></a><h4>Parameters</h4>
903 <div class="informaltable"><table class="informaltable" width="100%" border="0">
904 <colgroup>
905 <col width="150px" class="parameters_name">
906 <col class="parameters_description">
907 <col width="200px" class="parameters_annotations">
908 </colgroup>
909 <tbody>
910 <tr>
911 <td class="parameter_name"><p>cr</p></td>
912 <td class="parameter_description"><p>a cairo context</p></td>
913 <td class="parameter_annotations"> </td>
914 </tr>
915 <tr>
916 <td class="parameter_name"><p>x</p></td>
917 <td class="parameter_description"><p>the X coordinate of the new position</p></td>
918 <td class="parameter_annotations"> </td>
919 </tr>
920 <tr>
921 <td class="parameter_name"><p>y</p></td>
922 <td class="parameter_description"><p>the Y coordinate of the new position</p></td>
923 <td class="parameter_annotations"> </td>
924 </tr>
925 </tbody>
926 </table></div>
927 </div>
928 <p class="since">Since: 1.0</p>
929 </div>
930 <hr>
931 <div class="refsect2">
932 <a name="cairo-rectangle"></a><h3>cairo_rectangle ()</h3>
933 <pre class="programlisting"><span class="returnvalue">void</span>
934 cairo_rectangle (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
935 <em class="parameter"><code><span class="type">double</span> x</code></em>,
936 <em class="parameter"><code><span class="type">double</span> y</code></em>,
937 <em class="parameter"><code><span class="type">double</span> width</code></em>,
938 <em class="parameter"><code><span class="type">double</span> height</code></em>);</pre>
939 <p>Adds a closed sub-path rectangle of the given size to the current
940 path at position (<em class="parameter"><code>x</code></em>
941 , <em class="parameter"><code>y</code></em>
942 ) in user-space coordinates.</p>
943 <p>This function is logically equivalent to:</p>
944 <div class="informalexample">
945 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
946 <tbody>
947 <tr>
948 <td class="listing_lines" align="right"><pre>1
949 2
950 3
951 4
952 5</pre></td>
953 <td class="listing_code"><pre class="programlisting"><span class="function"><a href="cairo-Paths.html#cairo-move-to">cairo_move_to</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">);</span>
954 <span class="function"><a href="cairo-Paths.html#cairo-rel-line-to">cairo_rel_line_to</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> width<span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">);</span>
955 <span class="function"><a href="cairo-Paths.html#cairo-rel-line-to">cairo_rel_line_to</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">,</span> height<span class="gtkdoc opt">);</span>
956 <span class="function"><a href="cairo-Paths.html#cairo-rel-line-to">cairo_rel_line_to</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">, -</span>width<span class="gtkdoc opt">,</span> <span class="number">0</span><span class="gtkdoc opt">);</span>
957 <span class="function"><a href="cairo-Paths.html#cairo-close-path">cairo_close_path</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span></pre></td>
958 </tr>
959 </tbody>
960 </table>
961 </div>
962
963 <div class="refsect3">
964 <a name="cairo-rectangle.parameters"></a><h4>Parameters</h4>
965 <div class="informaltable"><table class="informaltable" width="100%" border="0">
966 <colgroup>
967 <col width="150px" class="parameters_name">
968 <col class="parameters_description">
969 <col width="200px" class="parameters_annotations">
970 </colgroup>
971 <tbody>
972 <tr>
973 <td class="parameter_name"><p>cr</p></td>
974 <td class="parameter_description"><p>a cairo context</p></td>
975 <td class="parameter_annotations"> </td>
976 </tr>
977 <tr>
978 <td class="parameter_name"><p>x</p></td>
979 <td class="parameter_description"><p>the X coordinate of the top left corner of the rectangle</p></td>
980 <td class="parameter_annotations"> </td>
981 </tr>
982 <tr>
983 <td class="parameter_name"><p>y</p></td>
984 <td class="parameter_description"><p>the Y coordinate to the top left corner of the rectangle</p></td>
985 <td class="parameter_annotations"> </td>
986 </tr>
987 <tr>
988 <td class="parameter_name"><p>width</p></td>
989 <td class="parameter_description"><p>the width of the rectangle</p></td>
990 <td class="parameter_annotations"> </td>
991 </tr>
992 <tr>
993 <td class="parameter_name"><p>height</p></td>
994 <td class="parameter_description"><p>the height of the rectangle</p></td>
995 <td class="parameter_annotations"> </td>
996 </tr>
997 </tbody>
998 </table></div>
999 </div>
1000 <p class="since">Since: 1.0</p>
1001 </div>
1002 <hr>
1003 <div class="refsect2">
1004 <a name="cairo-glyph-path"></a><h3>cairo_glyph_path ()</h3>
1005 <pre class="programlisting"><span class="returnvalue">void</span>
1006 cairo_glyph_path (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
1007 <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>,
1008 <em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>);</pre>
1009 <p>Adds closed paths for the glyphs to the current path. The generated
1010 path if filled, achieves an effect similar to that of
1011 <a class="link" href="cairo-text.html#cairo-show-glyphs" title="cairo_show_glyphs ()"><code class="function">cairo_show_glyphs()</code></a>.</p>
1012 <div class="refsect3">
1013 <a name="cairo-glyph-path.parameters"></a><h4>Parameters</h4>
1014 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1015 <colgroup>
1016 <col width="150px" class="parameters_name">
1017 <col class="parameters_description">
1018 <col width="200px" class="parameters_annotations">
1019 </colgroup>
1020 <tbody>
1021 <tr>
1022 <td class="parameter_name"><p>cr</p></td>
1023 <td class="parameter_description"><p>a cairo context</p></td>
1024 <td class="parameter_annotations"> </td>
1025 </tr>
1026 <tr>
1027 <td class="parameter_name"><p>glyphs</p></td>
1028 <td class="parameter_description"><p>array of glyphs to show</p></td>
1029 <td class="parameter_annotations"> </td>
1030 </tr>
1031 <tr>
1032 <td class="parameter_name"><p>num_glyphs</p></td>
1033 <td class="parameter_description"><p>number of glyphs to show</p></td>
1034 <td class="parameter_annotations"> </td>
1035 </tr>
1036 </tbody>
1037 </table></div>
1038 </div>
1039 <p class="since">Since: 1.0</p>
1040 </div>
1041 <hr>
1042 <div class="refsect2">
1043 <a name="cairo-text-path"></a><h3>cairo_text_path ()</h3>
1044 <pre class="programlisting"><span class="returnvalue">void</span>
1045 cairo_text_path (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
1046 <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>);</pre>
1047 <p>Adds closed paths for text to the current path. The generated
1048 path if filled, achieves an effect similar to that of
1049 <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a>.</p>
1050 <p>Text conversion and positioning is done similar to <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a>.</p>
1051 <p>Like <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a>, After this call the current point is
1052 moved to the origin of where the next glyph would be placed in
1053 this same progression. That is, the current point will be at
1054 the origin of the final glyph offset by its advance values.
1055 This allows for chaining multiple calls to to <a class="link" href="cairo-Paths.html#cairo-text-path" title="cairo_text_path ()"><code class="function">cairo_text_path()</code></a>
1056 without having to set current point in between.</p>
1057 <p>Note: The <a class="link" href="cairo-Paths.html#cairo-text-path" title="cairo_text_path ()"><code class="function">cairo_text_path()</code></a> function call is part of what the cairo
1058 designers call the "toy" text API. It is convenient for short demos
1059 and simple programs, but it is not expected to be adequate for
1060 serious text-using applications. See <a class="link" href="cairo-Paths.html#cairo-glyph-path" title="cairo_glyph_path ()"><code class="function">cairo_glyph_path()</code></a> for the
1061 "real" text path API in cairo.</p>
1062 <div class="refsect3">
1063 <a name="cairo-text-path.parameters"></a><h4>Parameters</h4>
1064 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1065 <colgroup>
1066 <col width="150px" class="parameters_name">
1067 <col class="parameters_description">
1068 <col width="200px" class="parameters_annotations">
1069 </colgroup>
1070 <tbody>
1071 <tr>
1072 <td class="parameter_name"><p>cr</p></td>
1073 <td class="parameter_description"><p>a cairo context</p></td>
1074 <td class="parameter_annotations"> </td>
1075 </tr>
1076 <tr>
1077 <td class="parameter_name"><p>utf8</p></td>
1078 <td class="parameter_description"><p>a NUL-terminated string of text encoded in UTF-8, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1079 <td class="parameter_annotations"> </td>
1080 </tr>
1081 </tbody>
1082 </table></div>
1083 </div>
1084 <p class="since">Since: 1.0</p>
1085 </div>
1086 <hr>
1087 <div class="refsect2">
1088 <a name="cairo-rel-curve-to"></a><h3>cairo_rel_curve_to ()</h3>
1089 <pre class="programlisting"><span class="returnvalue">void</span>
1090 cairo_rel_curve_to (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
1091 <em class="parameter"><code><span class="type">double</span> dx1</code></em>,
1092 <em class="parameter"><code><span class="type">double</span> dy1</code></em>,
1093 <em class="parameter"><code><span class="type">double</span> dx2</code></em>,
1094 <em class="parameter"><code><span class="type">double</span> dy2</code></em>,
1095 <em class="parameter"><code><span class="type">double</span> dx3</code></em>,
1096 <em class="parameter"><code><span class="type">double</span> dy3</code></em>);</pre>
1097 <p>Relative-coordinate version of <a class="link" href="cairo-Paths.html#cairo-curve-to" title="cairo_curve_to ()"><code class="function">cairo_curve_to()</code></a>. All offsets are
1098 relative to the current point. Adds a cubic Bézier spline to the
1099 path from the current point to a point offset from the current
1100 point by (<em class="parameter"><code>dx3</code></em>
1101 , <em class="parameter"><code>dy3</code></em>
1102 ), using points offset by (<em class="parameter"><code>dx1</code></em>
1103 , <em class="parameter"><code>dy1</code></em>
1104 ) and
1105 (<em class="parameter"><code>dx2</code></em>
1106 , <em class="parameter"><code>dy2</code></em>
1107 ) as the control points. After this call the current
1108 point will be offset by (<em class="parameter"><code>dx3</code></em>
1109 , <em class="parameter"><code>dy3</code></em>
1110 ).</p>
1111 <p>Given a current point of (x, y), cairo_rel_curve_to(<em class="parameter"><code>cr</code></em>
1112 , <em class="parameter"><code>dx1</code></em>
1113 ,
1114 <em class="parameter"><code>dy1</code></em>
1115 , <em class="parameter"><code>dx2</code></em>
1116 , <em class="parameter"><code>dy2</code></em>
1117 , <em class="parameter"><code>dx3</code></em>
1118 , <em class="parameter"><code>dy3</code></em>
1119 ) is logically equivalent to
1120 cairo_curve_to(<em class="parameter"><code>cr</code></em>
1121 , x+<em class="parameter"><code>dx1</code></em>
1122 , y+<em class="parameter"><code>dy1</code></em>
1123 , x+<em class="parameter"><code>dx2</code></em>
1124 , y+<em class="parameter"><code>dy2</code></em>
1125 , x+<em class="parameter"><code>dx3</code></em>
1126 , y+<em class="parameter"><code>dy3</code></em>
1127 ).</p>
1128 <p>It is an error to call this function with no current point. Doing
1129 so will cause <em class="parameter"><code>cr</code></em>
1130 to shutdown with a status of
1131 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-CURRENT-POINT:CAPS"><code class="literal">CAIRO_STATUS_NO_CURRENT_POINT</code></a>.</p>
1132 <div class="refsect3">
1133 <a name="cairo-rel-curve-to.parameters"></a><h4>Parameters</h4>
1134 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1135 <colgroup>
1136 <col width="150px" class="parameters_name">
1137 <col class="parameters_description">
1138 <col width="200px" class="parameters_annotations">
1139 </colgroup>
1140 <tbody>
1141 <tr>
1142 <td class="parameter_name"><p>cr</p></td>
1143 <td class="parameter_description"><p>a cairo context</p></td>
1144 <td class="parameter_annotations"> </td>
1145 </tr>
1146 <tr>
1147 <td class="parameter_name"><p>dx1</p></td>
1148 <td class="parameter_description"><p>the X offset to the first control point</p></td>
1149 <td class="parameter_annotations"> </td>
1150 </tr>
1151 <tr>
1152 <td class="parameter_name"><p>dy1</p></td>
1153 <td class="parameter_description"><p>the Y offset to the first control point</p></td>
1154 <td class="parameter_annotations"> </td>
1155 </tr>
1156 <tr>
1157 <td class="parameter_name"><p>dx2</p></td>
1158 <td class="parameter_description"><p>the X offset to the second control point</p></td>
1159 <td class="parameter_annotations"> </td>
1160 </tr>
1161 <tr>
1162 <td class="parameter_name"><p>dy2</p></td>
1163 <td class="parameter_description"><p>the Y offset to the second control point</p></td>
1164 <td class="parameter_annotations"> </td>
1165 </tr>
1166 <tr>
1167 <td class="parameter_name"><p>dx3</p></td>
1168 <td class="parameter_description"><p>the X offset to the end of the curve</p></td>
1169 <td class="parameter_annotations"> </td>
1170 </tr>
1171 <tr>
1172 <td class="parameter_name"><p>dy3</p></td>
1173 <td class="parameter_description"><p>the Y offset to the end of the curve</p></td>
1174 <td class="parameter_annotations"> </td>
1175 </tr>
1176 </tbody>
1177 </table></div>
1178 </div>
1179 <p class="since">Since: 1.0</p>
1180 </div>
1181 <hr>
1182 <div class="refsect2">
1183 <a name="cairo-rel-line-to"></a><h3>cairo_rel_line_to ()</h3>
1184 <pre class="programlisting"><span class="returnvalue">void</span>
1185 cairo_rel_line_to (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
1186 <em class="parameter"><code><span class="type">double</span> dx</code></em>,
1187 <em class="parameter"><code><span class="type">double</span> dy</code></em>);</pre>
1188 <p>Relative-coordinate version of <a class="link" href="cairo-Paths.html#cairo-line-to" title="cairo_line_to ()"><code class="function">cairo_line_to()</code></a>. Adds a line to the
1189 path from the current point to a point that is offset from the
1190 current point by (<em class="parameter"><code>dx</code></em>
1191 , <em class="parameter"><code>dy</code></em>
1192 ) in user space. After this call the
1193 current point will be offset by (<em class="parameter"><code>dx</code></em>
1194 , <em class="parameter"><code>dy</code></em>
1195 ).</p>
1196 <p>Given a current point of (x, y), cairo_rel_line_to(<em class="parameter"><code>cr</code></em>
1197 , <em class="parameter"><code>dx</code></em>
1198 , <em class="parameter"><code>dy</code></em>
1199 )
1200 is logically equivalent to cairo_line_to(<em class="parameter"><code>cr</code></em>
1201 , x + <em class="parameter"><code>dx</code></em>
1202 , y + <em class="parameter"><code>dy</code></em>
1203 ).</p>
1204 <p>It is an error to call this function with no current point. Doing
1205 so will cause <em class="parameter"><code>cr</code></em>
1206 to shutdown with a status of
1207 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-CURRENT-POINT:CAPS"><code class="literal">CAIRO_STATUS_NO_CURRENT_POINT</code></a>.</p>
1208 <div class="refsect3">
1209 <a name="cairo-rel-line-to.parameters"></a><h4>Parameters</h4>
1210 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1211 <colgroup>
1212 <col width="150px" class="parameters_name">
1213 <col class="parameters_description">
1214 <col width="200px" class="parameters_annotations">
1215 </colgroup>
1216 <tbody>
1217 <tr>
1218 <td class="parameter_name"><p>cr</p></td>
1219 <td class="parameter_description"><p>a cairo context</p></td>
1220 <td class="parameter_annotations"> </td>
1221 </tr>
1222 <tr>
1223 <td class="parameter_name"><p>dx</p></td>
1224 <td class="parameter_description"><p>the X offset to the end of the new line</p></td>
1225 <td class="parameter_annotations"> </td>
1226 </tr>
1227 <tr>
1228 <td class="parameter_name"><p>dy</p></td>
1229 <td class="parameter_description"><p>the Y offset to the end of the new line</p></td>
1230 <td class="parameter_annotations"> </td>
1231 </tr>
1232 </tbody>
1233 </table></div>
1234 </div>
1235 <p class="since">Since: 1.0</p>
1236 </div>
1237 <hr>
1238 <div class="refsect2">
1239 <a name="cairo-rel-move-to"></a><h3>cairo_rel_move_to ()</h3>
1240 <pre class="programlisting"><span class="returnvalue">void</span>
1241 cairo_rel_move_to (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
1242 <em class="parameter"><code><span class="type">double</span> dx</code></em>,
1243 <em class="parameter"><code><span class="type">double</span> dy</code></em>);</pre>
1244 <p>Begin a new sub-path. After this call the current point will offset
1245 by (<em class="parameter"><code>x</code></em>
1246 , <em class="parameter"><code>y</code></em>
1247 ).</p>
1248 <p>Given a current point of (x, y), cairo_rel_move_to(<em class="parameter"><code>cr</code></em>
1249 , <em class="parameter"><code>dx</code></em>
1250 , <em class="parameter"><code>dy</code></em>
1251 )
1252 is logically equivalent to cairo_move_to(<em class="parameter"><code>cr</code></em>
1253 , x + <em class="parameter"><code>dx</code></em>
1254 , y + <em class="parameter"><code>dy</code></em>
1255 ).</p>
1256 <p>It is an error to call this function with no current point. Doing
1257 so will cause <em class="parameter"><code>cr</code></em>
1258 to shutdown with a status of
1259 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-CURRENT-POINT:CAPS"><code class="literal">CAIRO_STATUS_NO_CURRENT_POINT</code></a>.</p>
1260 <div class="refsect3">
1261 <a name="cairo-rel-move-to.parameters"></a><h4>Parameters</h4>
1262 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1263 <colgroup>
1264 <col width="150px" class="parameters_name">
1265 <col class="parameters_description">
1266 <col width="200px" class="parameters_annotations">
1267 </colgroup>
1268 <tbody>
1269 <tr>
1270 <td class="parameter_name"><p>cr</p></td>
1271 <td class="parameter_description"><p>a cairo context</p></td>
1272 <td class="parameter_annotations"> </td>
1273 </tr>
1274 <tr>
1275 <td class="parameter_name"><p>dx</p></td>
1276 <td class="parameter_description"><p>the X offset</p></td>
1277 <td class="parameter_annotations"> </td>
1278 </tr>
1279 <tr>
1280 <td class="parameter_name"><p>dy</p></td>
1281 <td class="parameter_description"><p>the Y offset</p></td>
1282 <td class="parameter_annotations"> </td>
1283 </tr>
1284 </tbody>
1285 </table></div>
1286 </div>
1287 <p class="since">Since: 1.0</p>
1288 </div>
1289 <hr>
1290 <div class="refsect2">
1291 <a name="cairo-path-extents"></a><h3>cairo_path_extents ()</h3>
1292 <pre class="programlisting"><span class="returnvalue">void</span>
1293 cairo_path_extents (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
1294 <em class="parameter"><code><span class="type">double</span> *x1</code></em>,
1295 <em class="parameter"><code><span class="type">double</span> *y1</code></em>,
1296 <em class="parameter"><code><span class="type">double</span> *x2</code></em>,
1297 <em class="parameter"><code><span class="type">double</span> *y2</code></em>);</pre>
1298 <p>Computes a bounding box in user-space coordinates covering the
1299 points on the current path. If the current path is empty, returns
1300 an empty rectangle ((0,0), (0,0)). Stroke parameters, fill rule,
1301 surface dimensions and clipping are not taken into account.</p>
1302 <p>Contrast with <a class="link" href="cairo-cairo-t.html#cairo-fill-extents" title="cairo_fill_extents ()"><code class="function">cairo_fill_extents()</code></a> and <a class="link" href="cairo-cairo-t.html#cairo-stroke-extents" title="cairo_stroke_extents ()"><code class="function">cairo_stroke_extents()</code></a> which
1303 return the extents of only the area that would be "inked" by
1304 the corresponding drawing operations.</p>
1305 <p>The result of <a class="link" href="cairo-Paths.html#cairo-path-extents" title="cairo_path_extents ()"><code class="function">cairo_path_extents()</code></a> is defined as equivalent to the
1306 limit of <a class="link" href="cairo-cairo-t.html#cairo-stroke-extents" title="cairo_stroke_extents ()"><code class="function">cairo_stroke_extents()</code></a> with <a class="link" href="cairo-cairo-t.html#CAIRO-LINE-CAP-ROUND:CAPS"><code class="literal">CAIRO_LINE_CAP_ROUND</code></a> as the
1307 line width approaches 0.0, (but never reaching the empty-rectangle
1308 returned by <a class="link" href="cairo-cairo-t.html#cairo-stroke-extents" title="cairo_stroke_extents ()"><code class="function">cairo_stroke_extents()</code></a> for a line width of 0.0).</p>
1309 <p>Specifically, this means that zero-area sub-paths such as
1310 <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()"><code class="function">cairo_move_to()</code></a>;<a class="link" href="cairo-Paths.html#cairo-line-to" title="cairo_line_to ()"><code class="function">cairo_line_to()</code></a> segments, (even degenerate cases
1311 where the coordinates to both calls are identical), will be
1312 considered as contributing to the extents. However, a lone
1313 <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()"><code class="function">cairo_move_to()</code></a> will not contribute to the results of
1314 <a class="link" href="cairo-Paths.html#cairo-path-extents" title="cairo_path_extents ()"><code class="function">cairo_path_extents()</code></a>.</p>
1315 <div class="refsect3">
1316 <a name="cairo-path-extents.parameters"></a><h4>Parameters</h4>
1317 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1318 <colgroup>
1319 <col width="150px" class="parameters_name">
1320 <col class="parameters_description">
1321 <col width="200px" class="parameters_annotations">
1322 </colgroup>
1323 <tbody>
1324 <tr>
1325 <td class="parameter_name"><p>cr</p></td>
1326 <td class="parameter_description"><p>a cairo context</p></td>
1327 <td class="parameter_annotations"> </td>
1328 </tr>
1329 <tr>
1330 <td class="parameter_name"><p>x1</p></td>
1331 <td class="parameter_description"><p>left of the resulting extents</p></td>
1332 <td class="parameter_annotations"> </td>
1333 </tr>
1334 <tr>
1335 <td class="parameter_name"><p>y1</p></td>
1336 <td class="parameter_description"><p>top of the resulting extents</p></td>
1337 <td class="parameter_annotations"> </td>
1338 </tr>
1339 <tr>
1340 <td class="parameter_name"><p>x2</p></td>
1341 <td class="parameter_description"><p>right of the resulting extents</p></td>
1342 <td class="parameter_annotations"> </td>
1343 </tr>
1344 <tr>
1345 <td class="parameter_name"><p>y2</p></td>
1346 <td class="parameter_description"><p>bottom of the resulting extents</p></td>
1347 <td class="parameter_annotations"> </td>
1348 </tr>
1349 </tbody>
1350 </table></div>
1351 </div>
1352 <p class="since">Since: 1.6</p>
1353 </div>
1354 </div>
1355 <div class="refsect1">
1356 <a name="cairo-Paths.other_details"></a><h2>Types and Values</h2>
1357 <div class="refsect2">
1358 <a name="cairo-path-t"></a><h3>cairo_path_t</h3>
1359 <pre class="programlisting">typedef struct {
1360 cairo_status_t status;
1361 cairo_path_data_t *data;
1362 int num_data;
1363 } cairo_path_t;
1364 </pre>
1365 <p>A data structure for holding a path. This data structure serves as
1366 the return value for <a class="link" href="cairo-Paths.html#cairo-copy-path" title="cairo_copy_path ()"><code class="function">cairo_copy_path()</code></a> and
1367 <a class="link" href="cairo-Paths.html#cairo-copy-path-flat" title="cairo_copy_path_flat ()"><code class="function">cairo_copy_path_flat()</code></a> as well the input value for
1368 <a class="link" href="cairo-Paths.html#cairo-append-path" title="cairo_append_path ()"><code class="function">cairo_append_path()</code></a>.</p>
1369 <p>See <a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a> for hints on how to iterate over the
1370 actual data within the path.</p>
1371 <p>The num_data member gives the number of elements in the data
1372 array. This number is larger than the number of independent path
1373 portions (defined in <a class="link" href="cairo-Paths.html#cairo-path-data-type-t" title="enum cairo_path_data_type_t"><span class="type">cairo_path_data_type_t</span></a>), since the data
1374 includes both headers and coordinates for each portion.</p>
1375 <div class="refsect3">
1376 <a name="cairo-path-t.members"></a><h4>Members</h4>
1377 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1378 <colgroup>
1379 <col width="300px" class="struct_members_name">
1380 <col class="struct_members_description">
1381 <col width="200px" class="struct_members_annotations">
1382 </colgroup>
1383 <tbody>
1384 <tr>
1385 <td class="struct_member_name"><p><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="type">cairo_status_t</span></a> <em class="structfield"><code><a name="cairo-path-t.status"></a>status</code></em>;</p></td>
1386 <td class="struct_member_description"><p>the current error status</p></td>
1387 <td class="struct_member_annotations"> </td>
1388 </tr>
1389 <tr>
1390 <td class="struct_member_name"><p><a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a> *<em class="structfield"><code><a name="cairo-path-t.data"></a>data</code></em>;</p></td>
1391 <td class="struct_member_description"><p>the elements in the path</p></td>
1392 <td class="struct_member_annotations"> </td>
1393 </tr>
1394 <tr>
1395 <td class="struct_member_name"><p><span class="type">int</span> <em class="structfield"><code><a name="cairo-path-t.num-data"></a>num_data</code></em>;</p></td>
1396 <td class="struct_member_description"><p>the number of elements in the data array</p></td>
1397 <td class="struct_member_annotations"> </td>
1398 </tr>
1399 </tbody>
1400 </table></div>
1401 </div>
1402 <p class="since">Since: 1.0</p>
1403 </div>
1404 <hr>
1405 <div class="refsect2">
1406 <a name="cairo-path-data-t"></a><h3>union cairo_path_data_t</h3>
1407 <p><a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a> is used to represent the path data inside a
1408 <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a>.</p>
1409 <p>The data structure is designed to try to balance the demands of
1410 efficiency and ease-of-use. A path is represented as an array of
1411 <a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a>, which is a union of headers and points.</p>
1412 <p>Each portion of the path is represented by one or more elements in
1413 the array, (one header followed by 0 or more points). The length
1414 value of the header is the number of array elements for the current
1415 portion including the header, (ie. length == 1 + # of points), and
1416 where the number of points for each element type is as follows:</p>
1417 <pre class="programlisting">
1418 %CAIRO_PATH_MOVE_TO: 1 point
1419 %CAIRO_PATH_LINE_TO: 1 point
1420 %CAIRO_PATH_CURVE_TO: 3 points
1421 %CAIRO_PATH_CLOSE_PATH: 0 points
1422 </pre>
1423 <p>The semantics and ordering of the coordinate values are consistent
1424 with <a class="link" href="cairo-Paths.html#cairo-move-to" title="cairo_move_to ()"><code class="function">cairo_move_to()</code></a>, <a class="link" href="cairo-Paths.html#cairo-line-to" title="cairo_line_to ()"><code class="function">cairo_line_to()</code></a>, <a class="link" href="cairo-Paths.html#cairo-curve-to" title="cairo_curve_to ()"><code class="function">cairo_curve_to()</code></a>, and
1425 <a class="link" href="cairo-Paths.html#cairo-close-path" title="cairo_close_path ()"><code class="function">cairo_close_path()</code></a>.</p>
1426 <p>Here is sample code for iterating through a <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a>:</p>
1427 <div class="informalexample">
1428 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
1429 <tbody>
1430 <tr>
1431 <td class="listing_lines" align="right"><pre>1
1432 2
1433 3
1434 4
1435 5
1436 6
1437 7
1438 8
1439 9
1440 10
1441 11
1442 12
1443 13
1444 14
1445 15
1446 16
1447 17
1448 18
1449 19
1450 20
1451 21
1452 22
1453 23
1454 24
1455 25
1456 26</pre></td>
1457 <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">int</span> i<span class="gtkdoc opt">;</span>
1458 cairo_path_t <span class="gtkdoc opt">*</span>path<span class="gtkdoc opt">;</span>
1459 cairo_path_data_t <span class="gtkdoc opt">*</span>data<span class="gtkdoc opt">;</span>
1460  
1461 path <span class="gtkdoc opt">=</span> <span class="function"><a href="cairo-Paths.html#cairo-copy-path">cairo_copy_path</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span>
1462  
1463 <span class="keyword">for</span> <span class="gtkdoc opt">(</span>i<span class="gtkdoc opt">=</span><span class="number">0</span><span class="gtkdoc opt">;</span> i <span class="gtkdoc opt">&lt;</span> path<span class="gtkdoc opt">-&gt;</span>num_data<span class="gtkdoc opt">;</span> i <span class="gtkdoc opt">+=</span> path<span class="gtkdoc opt">-&gt;</span>data<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">].</span>header<span class="gtkdoc opt">.</span>length<span class="gtkdoc opt">) {</span>
1464 data <span class="gtkdoc opt">= &amp;</span>path<span class="gtkdoc opt">-&gt;</span>data<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">];</span>
1465 <span class="keyword">switch</span> <span class="gtkdoc opt">(</span>data<span class="gtkdoc opt">-&gt;</span>header<span class="gtkdoc opt">.</span>type<span class="gtkdoc opt">) {</span>
1466 <span class="keyword">case</span> CAIRO_PATH_MOVE_TO<span class="gtkdoc opt">:</span>
1467 <span class="function">do_move_to_things</span> <span class="gtkdoc opt">(</span>data<span class="gtkdoc opt">[</span><span class="number">1</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>x<span class="gtkdoc opt">,</span> data<span class="gtkdoc opt">[</span><span class="number">1</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>y<span class="gtkdoc opt">);</span>
1468 <span class="keyword">break</span><span class="gtkdoc opt">;</span>
1469 <span class="keyword">case</span> CAIRO_PATH_LINE_TO<span class="gtkdoc opt">:</span>
1470 <span class="function">do_line_to_things</span> <span class="gtkdoc opt">(</span>data<span class="gtkdoc opt">[</span><span class="number">1</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>x<span class="gtkdoc opt">,</span> data<span class="gtkdoc opt">[</span><span class="number">1</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>y<span class="gtkdoc opt">);</span>
1471 <span class="keyword">break</span><span class="gtkdoc opt">;</span>
1472 <span class="keyword">case</span> CAIRO_PATH_CURVE_TO<span class="gtkdoc opt">:</span>
1473 <span class="function">do_curve_to_things</span> <span class="gtkdoc opt">(</span>data<span class="gtkdoc opt">[</span><span class="number">1</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>x<span class="gtkdoc opt">,</span> data<span class="gtkdoc opt">[</span><span class="number">1</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>y<span class="gtkdoc opt">,</span>
1474 data<span class="gtkdoc opt">[</span><span class="number">2</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>x<span class="gtkdoc opt">,</span> data<span class="gtkdoc opt">[</span><span class="number">2</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>y<span class="gtkdoc opt">,</span>
1475 data<span class="gtkdoc opt">[</span><span class="number">3</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>x<span class="gtkdoc opt">,</span> data<span class="gtkdoc opt">[</span><span class="number">3</span><span class="gtkdoc opt">].</span>point<span class="gtkdoc opt">.</span>y<span class="gtkdoc opt">);</span>
1476 <span class="keyword">break</span><span class="gtkdoc opt">;</span>
1477 <span class="keyword">case</span> CAIRO_PATH_CLOSE_PATH<span class="gtkdoc opt">:</span>
1478 <span class="function">do_close_path_things</span> <span class="gtkdoc opt">();</span>
1479 <span class="keyword">break</span><span class="gtkdoc opt">;</span>
1480 <span class="gtkdoc opt">}</span>
1481 <span class="gtkdoc opt">}</span>
1482 <span class="function"><a href="cairo-Paths.html#cairo-path-destroy">cairo_path_destroy</a></span> <span class="gtkdoc opt">(</span>path<span class="gtkdoc opt">);</span></pre></td>
1483 </tr>
1484 </tbody>
1485 </table>
1486 </div>
1487
1488 <p>As of cairo 1.4, cairo does not mind if there are more elements in
1489 a portion of the path than needed. Such elements can be used by
1490 users of the cairo API to hold extra values in the path data
1491 structure. For this reason, it is recommended that applications
1492 always use <code class="literal">data-&gt;header.length</code> to
1493 iterate over the path data, instead of hardcoding the number of
1494 elements for each element type.</p>
1495 <p class="since">Since: 1.0</p>
1496 </div>
1497 <hr>
1498 <div class="refsect2">
1499 <a name="cairo-path-data-type-t"></a><h3>enum cairo_path_data_type_t</h3>
1500 <p><a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a> is used to describe the type of one portion
1501 of a path when represented as a <a class="link" href="cairo-Paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a>.
1502 See <a class="link" href="cairo-Paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a> for details.</p>
1503 <div class="refsect3">
1504 <a name="cairo-path-data-type-t.members"></a><h4>Members</h4>
1505 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1506 <colgroup>
1507 <col width="300px" class="enum_members_name">
1508 <col class="enum_members_description">
1509 <col width="200px" class="enum_members_annotations">
1510 </colgroup>
1511 <tbody>
1512 <tr>
1513 <td class="enum_member_name"><p><a name="CAIRO-PATH-MOVE-TO:CAPS"></a>CAIRO_PATH_MOVE_TO</p></td>
1514 <td class="enum_member_description">
1515 <p>A move-to operation, since 1.0</p>
1516 </td>
1517 <td class="enum_member_annotations"> </td>
1518 </tr>
1519 <tr>
1520 <td class="enum_member_name"><p><a name="CAIRO-PATH-LINE-TO:CAPS"></a>CAIRO_PATH_LINE_TO</p></td>
1521 <td class="enum_member_description">
1522 <p>A line-to operation, since 1.0</p>
1523 </td>
1524 <td class="enum_member_annotations"> </td>
1525 </tr>
1526 <tr>
1527 <td class="enum_member_name"><p><a name="CAIRO-PATH-CURVE-TO:CAPS"></a>CAIRO_PATH_CURVE_TO</p></td>
1528 <td class="enum_member_description">
1529 <p>A curve-to operation, since 1.0</p>
1530 </td>
1531 <td class="enum_member_annotations"> </td>
1532 </tr>
1533 <tr>
1534 <td class="enum_member_name"><p><a name="CAIRO-PATH-CLOSE-PATH:CAPS"></a>CAIRO_PATH_CLOSE_PATH</p></td>
1535 <td class="enum_member_description">
1536 <p>A close-path operation, since 1.0</p>
1537 </td>
1538 <td class="enum_member_annotations"> </td>
1539 </tr>
1540 </tbody>
1541 </table></div>
1542 </div>
1543 <p class="since">Since: 1.0</p>
1544 </div>
1545 </div>
1546 </div>
1547 <div class="footer">
1548 <hr>Generated by GTK-Doc V1.27</div>
1549 </body>
1550 </html>