jpayne@68
|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
jpayne@68
|
2 <html>
|
jpayne@68
|
3 <head>
|
jpayne@68
|
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
jpayne@68
|
5 <title>cairo_device_t: Cairo: A Vector Graphics Library</title>
|
jpayne@68
|
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
jpayne@68
|
7 <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
|
jpayne@68
|
8 <link rel="up" href="cairo-surfaces.html" title="Surfaces">
|
jpayne@68
|
9 <link rel="prev" href="cairo-surfaces.html" title="Surfaces">
|
jpayne@68
|
10 <link rel="next" href="cairo-cairo-surface-t.html" title="cairo_surface_t">
|
jpayne@68
|
11 <meta name="generator" content="GTK-Doc V1.27 (XML mode)">
|
jpayne@68
|
12 <link rel="stylesheet" href="style.css" type="text/css">
|
jpayne@68
|
13 </head>
|
jpayne@68
|
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
jpayne@68
|
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
|
jpayne@68
|
16 <td width="100%" align="left" class="shortcuts">
|
jpayne@68
|
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
|
jpayne@68
|
18 <a href="#cairo-cairo-device-t.description" class="shortcut">Description</a></span>
|
jpayne@68
|
19 </td>
|
jpayne@68
|
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
|
jpayne@68
|
21 <td><a accesskey="u" href="cairo-surfaces.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
|
jpayne@68
|
22 <td><a accesskey="p" href="cairo-surfaces.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
|
jpayne@68
|
23 <td><a accesskey="n" href="cairo-cairo-surface-t.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
|
jpayne@68
|
24 </tr></table>
|
jpayne@68
|
25 <div class="refentry">
|
jpayne@68
|
26 <a name="cairo-cairo-device-t"></a><div class="titlepage"></div>
|
jpayne@68
|
27 <div class="refnamediv"><table width="100%"><tr>
|
jpayne@68
|
28 <td valign="top">
|
jpayne@68
|
29 <h2><span class="refentrytitle"><a name="cairo-cairo-device-t.top_of_page"></a>cairo_device_t</span></h2>
|
jpayne@68
|
30 <p>cairo_device_t — interface to underlying rendering system</p>
|
jpayne@68
|
31 </td>
|
jpayne@68
|
32 <td class="gallery_image" valign="top" align="right"></td>
|
jpayne@68
|
33 </tr></table></div>
|
jpayne@68
|
34 <div class="refsect1">
|
jpayne@68
|
35 <a name="cairo-cairo-device-t.functions"></a><h2>Functions</h2>
|
jpayne@68
|
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
37 <colgroup>
|
jpayne@68
|
38 <col width="150px" class="functions_return">
|
jpayne@68
|
39 <col class="functions_name">
|
jpayne@68
|
40 </colgroup>
|
jpayne@68
|
41 <tbody>
|
jpayne@68
|
42 <tr>
|
jpayne@68
|
43 <td class="function_type">
|
jpayne@68
|
44 <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="returnvalue">cairo_device_t</span></a> *
|
jpayne@68
|
45 </td>
|
jpayne@68
|
46 <td class="function_name">
|
jpayne@68
|
47 <a class="link" href="cairo-cairo-device-t.html#cairo-device-reference" title="cairo_device_reference ()">cairo_device_reference</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
48 </td>
|
jpayne@68
|
49 </tr>
|
jpayne@68
|
50 <tr>
|
jpayne@68
|
51 <td class="function_type">
|
jpayne@68
|
52 <span class="returnvalue">void</span>
|
jpayne@68
|
53 </td>
|
jpayne@68
|
54 <td class="function_name">
|
jpayne@68
|
55 <a class="link" href="cairo-cairo-device-t.html#cairo-device-destroy" title="cairo_device_destroy ()">cairo_device_destroy</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
56 </td>
|
jpayne@68
|
57 </tr>
|
jpayne@68
|
58 <tr>
|
jpayne@68
|
59 <td class="function_type">
|
jpayne@68
|
60 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
61 </td>
|
jpayne@68
|
62 <td class="function_name">
|
jpayne@68
|
63 <a class="link" href="cairo-cairo-device-t.html#cairo-device-status" title="cairo_device_status ()">cairo_device_status</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
64 </td>
|
jpayne@68
|
65 </tr>
|
jpayne@68
|
66 <tr>
|
jpayne@68
|
67 <td class="function_type">
|
jpayne@68
|
68 <span class="returnvalue">void</span>
|
jpayne@68
|
69 </td>
|
jpayne@68
|
70 <td class="function_name">
|
jpayne@68
|
71 <a class="link" href="cairo-cairo-device-t.html#cairo-device-finish" title="cairo_device_finish ()">cairo_device_finish</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
72 </td>
|
jpayne@68
|
73 </tr>
|
jpayne@68
|
74 <tr>
|
jpayne@68
|
75 <td class="function_type">
|
jpayne@68
|
76 <span class="returnvalue">void</span>
|
jpayne@68
|
77 </td>
|
jpayne@68
|
78 <td class="function_name">
|
jpayne@68
|
79 <a class="link" href="cairo-cairo-device-t.html#cairo-device-flush" title="cairo_device_flush ()">cairo_device_flush</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
80 </td>
|
jpayne@68
|
81 </tr>
|
jpayne@68
|
82 <tr>
|
jpayne@68
|
83 <td class="function_type">
|
jpayne@68
|
84 <a class="link" href="cairo-cairo-device-t.html#cairo-device-type-t" title="enum cairo_device_type_t"><span class="returnvalue">cairo_device_type_t</span></a>
|
jpayne@68
|
85 </td>
|
jpayne@68
|
86 <td class="function_name">
|
jpayne@68
|
87 <a class="link" href="cairo-cairo-device-t.html#cairo-device-get-type" title="cairo_device_get_type ()">cairo_device_get_type</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
88 </td>
|
jpayne@68
|
89 </tr>
|
jpayne@68
|
90 <tr>
|
jpayne@68
|
91 <td class="function_type">unsigned <span class="returnvalue">int</span>
|
jpayne@68
|
92 </td>
|
jpayne@68
|
93 <td class="function_name">
|
jpayne@68
|
94 <a class="link" href="cairo-cairo-device-t.html#cairo-device-get-reference-count" title="cairo_device_get_reference_count ()">cairo_device_get_reference_count</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
95 </td>
|
jpayne@68
|
96 </tr>
|
jpayne@68
|
97 <tr>
|
jpayne@68
|
98 <td class="function_type">
|
jpayne@68
|
99 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
100 </td>
|
jpayne@68
|
101 <td class="function_name">
|
jpayne@68
|
102 <a class="link" href="cairo-cairo-device-t.html#cairo-device-set-user-data" title="cairo_device_set_user_data ()">cairo_device_set_user_data</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
103 </td>
|
jpayne@68
|
104 </tr>
|
jpayne@68
|
105 <tr>
|
jpayne@68
|
106 <td class="function_type">
|
jpayne@68
|
107 <span class="returnvalue">void</span> *
|
jpayne@68
|
108 </td>
|
jpayne@68
|
109 <td class="function_name">
|
jpayne@68
|
110 <a class="link" href="cairo-cairo-device-t.html#cairo-device-get-user-data" title="cairo_device_get_user_data ()">cairo_device_get_user_data</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
111 </td>
|
jpayne@68
|
112 </tr>
|
jpayne@68
|
113 <tr>
|
jpayne@68
|
114 <td class="function_type">
|
jpayne@68
|
115 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
116 </td>
|
jpayne@68
|
117 <td class="function_name">
|
jpayne@68
|
118 <a class="link" href="cairo-cairo-device-t.html#cairo-device-acquire" title="cairo_device_acquire ()">cairo_device_acquire</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
119 </td>
|
jpayne@68
|
120 </tr>
|
jpayne@68
|
121 <tr>
|
jpayne@68
|
122 <td class="function_type">
|
jpayne@68
|
123 <span class="returnvalue">void</span>
|
jpayne@68
|
124 </td>
|
jpayne@68
|
125 <td class="function_name">
|
jpayne@68
|
126 <a class="link" href="cairo-cairo-device-t.html#cairo-device-release" title="cairo_device_release ()">cairo_device_release</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
127 </td>
|
jpayne@68
|
128 </tr>
|
jpayne@68
|
129 <tr>
|
jpayne@68
|
130 <td class="function_type">
|
jpayne@68
|
131 <span class="returnvalue">double</span>
|
jpayne@68
|
132 </td>
|
jpayne@68
|
133 <td class="function_name">
|
jpayne@68
|
134 <a class="link" href="cairo-cairo-device-t.html#cairo-device-observer-elapsed" title="cairo_device_observer_elapsed ()">cairo_device_observer_elapsed</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
135 </td>
|
jpayne@68
|
136 </tr>
|
jpayne@68
|
137 <tr>
|
jpayne@68
|
138 <td class="function_type">
|
jpayne@68
|
139 <span class="returnvalue">double</span>
|
jpayne@68
|
140 </td>
|
jpayne@68
|
141 <td class="function_name">
|
jpayne@68
|
142 <a class="link" href="cairo-cairo-device-t.html#cairo-device-observer-fill-elapsed" title="cairo_device_observer_fill_elapsed ()">cairo_device_observer_fill_elapsed</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
143 </td>
|
jpayne@68
|
144 </tr>
|
jpayne@68
|
145 <tr>
|
jpayne@68
|
146 <td class="function_type">
|
jpayne@68
|
147 <span class="returnvalue">double</span>
|
jpayne@68
|
148 </td>
|
jpayne@68
|
149 <td class="function_name">
|
jpayne@68
|
150 <a class="link" href="cairo-cairo-device-t.html#cairo-device-observer-glyphs-elapsed" title="cairo_device_observer_glyphs_elapsed ()">cairo_device_observer_glyphs_elapsed</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
151 </td>
|
jpayne@68
|
152 </tr>
|
jpayne@68
|
153 <tr>
|
jpayne@68
|
154 <td class="function_type">
|
jpayne@68
|
155 <span class="returnvalue">double</span>
|
jpayne@68
|
156 </td>
|
jpayne@68
|
157 <td class="function_name">
|
jpayne@68
|
158 <a class="link" href="cairo-cairo-device-t.html#cairo-device-observer-mask-elapsed" title="cairo_device_observer_mask_elapsed ()">cairo_device_observer_mask_elapsed</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
159 </td>
|
jpayne@68
|
160 </tr>
|
jpayne@68
|
161 <tr>
|
jpayne@68
|
162 <td class="function_type">
|
jpayne@68
|
163 <span class="returnvalue">double</span>
|
jpayne@68
|
164 </td>
|
jpayne@68
|
165 <td class="function_name">
|
jpayne@68
|
166 <a class="link" href="cairo-cairo-device-t.html#cairo-device-observer-paint-elapsed" title="cairo_device_observer_paint_elapsed ()">cairo_device_observer_paint_elapsed</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
167 </td>
|
jpayne@68
|
168 </tr>
|
jpayne@68
|
169 <tr>
|
jpayne@68
|
170 <td class="function_type">
|
jpayne@68
|
171 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
172 </td>
|
jpayne@68
|
173 <td class="function_name">
|
jpayne@68
|
174 <a class="link" href="cairo-cairo-device-t.html#cairo-device-observer-print" title="cairo_device_observer_print ()">cairo_device_observer_print</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
175 </td>
|
jpayne@68
|
176 </tr>
|
jpayne@68
|
177 <tr>
|
jpayne@68
|
178 <td class="function_type">
|
jpayne@68
|
179 <span class="returnvalue">double</span>
|
jpayne@68
|
180 </td>
|
jpayne@68
|
181 <td class="function_name">
|
jpayne@68
|
182 <a class="link" href="cairo-cairo-device-t.html#cairo-device-observer-stroke-elapsed" title="cairo_device_observer_stroke_elapsed ()">cairo_device_observer_stroke_elapsed</a> <span class="c_punctuation">()</span>
|
jpayne@68
|
183 </td>
|
jpayne@68
|
184 </tr>
|
jpayne@68
|
185 </tbody>
|
jpayne@68
|
186 </table></div>
|
jpayne@68
|
187 </div>
|
jpayne@68
|
188 <div class="refsect1">
|
jpayne@68
|
189 <a name="cairo-cairo-device-t.other"></a><h2>Types and Values</h2>
|
jpayne@68
|
190 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
191 <colgroup>
|
jpayne@68
|
192 <col width="150px" class="name">
|
jpayne@68
|
193 <col class="description">
|
jpayne@68
|
194 </colgroup>
|
jpayne@68
|
195 <tbody>
|
jpayne@68
|
196 <tr>
|
jpayne@68
|
197 <td class="typedef_keyword">typedef</td>
|
jpayne@68
|
198 <td class="function_name"><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t">cairo_device_t</a></td>
|
jpayne@68
|
199 </tr>
|
jpayne@68
|
200 <tr>
|
jpayne@68
|
201 <td class="datatype_keyword">enum</td>
|
jpayne@68
|
202 <td class="function_name"><a class="link" href="cairo-cairo-device-t.html#cairo-device-type-t" title="enum cairo_device_type_t">cairo_device_type_t</a></td>
|
jpayne@68
|
203 </tr>
|
jpayne@68
|
204 </tbody>
|
jpayne@68
|
205 </table></div>
|
jpayne@68
|
206 </div>
|
jpayne@68
|
207 <div class="refsect1">
|
jpayne@68
|
208 <a name="cairo-cairo-device-t.description"></a><h2>Description</h2>
|
jpayne@68
|
209 <p>Devices are the abstraction Cairo employs for the rendering system
|
jpayne@68
|
210 used by a <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a>. You can get the device of a surface using
|
jpayne@68
|
211 <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-get-device" title="cairo_surface_get_device ()"><code class="function">cairo_surface_get_device()</code></a>.</p>
|
jpayne@68
|
212 <p>Devices are created using custom functions specific to the rendering
|
jpayne@68
|
213 system you want to use. See the documentation for the surface types
|
jpayne@68
|
214 for those functions.</p>
|
jpayne@68
|
215 <p>An important function that devices fulfill is sharing access to the
|
jpayne@68
|
216 rendering system between Cairo and your application. If you want to
|
jpayne@68
|
217 access a device directly that you used to draw to with Cairo, you must
|
jpayne@68
|
218 first call <a class="link" href="cairo-cairo-device-t.html#cairo-device-flush" title="cairo_device_flush ()"><code class="function">cairo_device_flush()</code></a> to ensure that Cairo finishes all
|
jpayne@68
|
219 operations on the device and resets it to a clean state.</p>
|
jpayne@68
|
220 <p>Cairo also provides the functions <a class="link" href="cairo-cairo-device-t.html#cairo-device-acquire" title="cairo_device_acquire ()"><code class="function">cairo_device_acquire()</code></a> and
|
jpayne@68
|
221 <a class="link" href="cairo-cairo-device-t.html#cairo-device-release" title="cairo_device_release ()"><code class="function">cairo_device_release()</code></a> to synchronize access to the rendering system
|
jpayne@68
|
222 in a multithreaded environment. This is done internally, but can also
|
jpayne@68
|
223 be used by applications.</p>
|
jpayne@68
|
224 <p>Putting this all together, a function that works with devices should
|
jpayne@68
|
225 look something like this:</p>
|
jpayne@68
|
226 <div class="informalexample">
|
jpayne@68
|
227 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
jpayne@68
|
228 <tbody>
|
jpayne@68
|
229 <tr>
|
jpayne@68
|
230 <td class="listing_lines" align="right"><pre>1
|
jpayne@68
|
231 2
|
jpayne@68
|
232 3
|
jpayne@68
|
233 4
|
jpayne@68
|
234 5
|
jpayne@68
|
235 6
|
jpayne@68
|
236 7
|
jpayne@68
|
237 8
|
jpayne@68
|
238 9
|
jpayne@68
|
239 10
|
jpayne@68
|
240 11
|
jpayne@68
|
241 12
|
jpayne@68
|
242 13
|
jpayne@68
|
243 14
|
jpayne@68
|
244 15
|
jpayne@68
|
245 16
|
jpayne@68
|
246 17
|
jpayne@68
|
247 18
|
jpayne@68
|
248 19
|
jpayne@68
|
249 20</pre></td>
|
jpayne@68
|
250 <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">void</span>
|
jpayne@68
|
251 <span class="function">my_device_modifying_function</span> <span class="gtkdoc opt">(</span>cairo_device_t <span class="gtkdoc opt">*</span>device<span class="gtkdoc opt">)</span>
|
jpayne@68
|
252 <span class="gtkdoc opt">{</span>
|
jpayne@68
|
253 cairo_status_t status<span class="gtkdoc opt">;</span>
|
jpayne@68
|
254
|
jpayne@68
|
255 <span class="gtkdoc slc">// Ensure the device is properly reset</span>
|
jpayne@68
|
256 <span class="function"><a href="cairo-cairo-device-t.html#cairo-device-flush">cairo_device_flush</a></span> <span class="gtkdoc opt">(</span>device<span class="gtkdoc opt">);</span>
|
jpayne@68
|
257 <span class="gtkdoc slc">// Try to acquire the device</span>
|
jpayne@68
|
258 status <span class="gtkdoc opt">=</span> <span class="function"><a href="cairo-cairo-device-t.html#cairo-device-acquire">cairo_device_acquire</a></span> <span class="gtkdoc opt">(</span>device<span class="gtkdoc opt">);</span>
|
jpayne@68
|
259 <span class="keyword">if</span> <span class="gtkdoc opt">(</span>status <span class="gtkdoc opt">!=</span> CAIRO_STATUS_SUCCESS<span class="gtkdoc opt">) {</span>
|
jpayne@68
|
260 <span class="function">printf</span> <span class="gtkdoc opt">(</span><span class="string">"Failed to acquire the device: %s</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> <span class="function"><a href="cairo-Error-handling.html#cairo-status-to-string">cairo_status_to_string</a></span> <span class="gtkdoc opt">(</span>status<span class="gtkdoc opt">));</span>
|
jpayne@68
|
261 <span class="keyword">return</span><span class="gtkdoc opt">;</span>
|
jpayne@68
|
262 <span class="gtkdoc opt">}</span>
|
jpayne@68
|
263
|
jpayne@68
|
264 <span class="gtkdoc slc">// Do the custom operations on the device here.</span>
|
jpayne@68
|
265 <span class="gtkdoc slc">// But do not call any Cairo functions that might acquire devices.</span>
|
jpayne@68
|
266
|
jpayne@68
|
267 <span class="gtkdoc slc">// Release the device when done.</span>
|
jpayne@68
|
268 <span class="function"><a href="cairo-cairo-device-t.html#cairo-device-release">cairo_device_release</a></span> <span class="gtkdoc opt">(</span>device<span class="gtkdoc opt">);</span>
|
jpayne@68
|
269 <span class="gtkdoc opt">}</span></pre></td>
|
jpayne@68
|
270 </tr>
|
jpayne@68
|
271 </tbody>
|
jpayne@68
|
272 </table>
|
jpayne@68
|
273 </div>
|
jpayne@68
|
274
|
jpayne@68
|
275 <div class="note"><p>Please refer to the documentation of each backend for
|
jpayne@68
|
276 additional usage requirements, guarantees provided, and
|
jpayne@68
|
277 interactions with existing surface API of the device functions for
|
jpayne@68
|
278 surfaces of that type.
|
jpayne@68
|
279 </p></div>
|
jpayne@68
|
280 </div>
|
jpayne@68
|
281 <div class="refsect1">
|
jpayne@68
|
282 <a name="cairo-cairo-device-t.functions_details"></a><h2>Functions</h2>
|
jpayne@68
|
283 <div class="refsect2">
|
jpayne@68
|
284 <a name="cairo-device-reference"></a><h3>cairo_device_reference ()</h3>
|
jpayne@68
|
285 <pre class="programlisting"><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="returnvalue">cairo_device_t</span></a> *
|
jpayne@68
|
286 cairo_device_reference (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
287 <p>Increases the reference count on <em class="parameter"><code>device</code></em>
|
jpayne@68
|
288 by one. This prevents
|
jpayne@68
|
289 <em class="parameter"><code>device</code></em>
|
jpayne@68
|
290 from being destroyed until a matching call to
|
jpayne@68
|
291 <a class="link" href="cairo-cairo-device-t.html#cairo-device-destroy" title="cairo_device_destroy ()"><code class="function">cairo_device_destroy()</code></a> is made.</p>
|
jpayne@68
|
292 <p>Use <a class="link" href="cairo-cairo-device-t.html#cairo-device-get-reference-count" title="cairo_device_get_reference_count ()"><code class="function">cairo_device_get_reference_count()</code></a> to get the number of references
|
jpayne@68
|
293 to a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a>.</p>
|
jpayne@68
|
294 <div class="refsect3">
|
jpayne@68
|
295 <a name="cairo-device-reference.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
296 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
297 <colgroup>
|
jpayne@68
|
298 <col width="150px" class="parameters_name">
|
jpayne@68
|
299 <col class="parameters_description">
|
jpayne@68
|
300 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
301 </colgroup>
|
jpayne@68
|
302 <tbody><tr>
|
jpayne@68
|
303 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
304 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
305 <td class="parameter_annotations"> </td>
|
jpayne@68
|
306 </tr></tbody>
|
jpayne@68
|
307 </table></div>
|
jpayne@68
|
308 </div>
|
jpayne@68
|
309 <div class="refsect3">
|
jpayne@68
|
310 <a name="cairo-device-reference.returns"></a><h4>Returns</h4>
|
jpayne@68
|
311 <p> the referenced <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a>.</p>
|
jpayne@68
|
312 </div>
|
jpayne@68
|
313 <p class="since">Since: 1.10</p>
|
jpayne@68
|
314 </div>
|
jpayne@68
|
315 <hr>
|
jpayne@68
|
316 <div class="refsect2">
|
jpayne@68
|
317 <a name="cairo-device-destroy"></a><h3>cairo_device_destroy ()</h3>
|
jpayne@68
|
318 <pre class="programlisting"><span class="returnvalue">void</span>
|
jpayne@68
|
319 cairo_device_destroy (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
320 <p>Decreases the reference count on <em class="parameter"><code>device</code></em>
|
jpayne@68
|
321 by one. If the result is
|
jpayne@68
|
322 zero, then <em class="parameter"><code>device</code></em>
|
jpayne@68
|
323 and all associated resources are freed. See
|
jpayne@68
|
324 <a class="link" href="cairo-cairo-device-t.html#cairo-device-reference" title="cairo_device_reference ()"><code class="function">cairo_device_reference()</code></a>.</p>
|
jpayne@68
|
325 <p>This function may acquire devices if the last reference was dropped.</p>
|
jpayne@68
|
326 <div class="refsect3">
|
jpayne@68
|
327 <a name="cairo-device-destroy.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
328 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
329 <colgroup>
|
jpayne@68
|
330 <col width="150px" class="parameters_name">
|
jpayne@68
|
331 <col class="parameters_description">
|
jpayne@68
|
332 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
333 </colgroup>
|
jpayne@68
|
334 <tbody><tr>
|
jpayne@68
|
335 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
336 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
337 <td class="parameter_annotations"> </td>
|
jpayne@68
|
338 </tr></tbody>
|
jpayne@68
|
339 </table></div>
|
jpayne@68
|
340 </div>
|
jpayne@68
|
341 <p class="since">Since: 1.10</p>
|
jpayne@68
|
342 </div>
|
jpayne@68
|
343 <hr>
|
jpayne@68
|
344 <div class="refsect2">
|
jpayne@68
|
345 <a name="cairo-device-status"></a><h3>cairo_device_status ()</h3>
|
jpayne@68
|
346 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
347 cairo_device_status (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
348 <p>Checks whether an error has previously occurred for this
|
jpayne@68
|
349 device.</p>
|
jpayne@68
|
350 <div class="refsect3">
|
jpayne@68
|
351 <a name="cairo-device-status.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
352 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
353 <colgroup>
|
jpayne@68
|
354 <col width="150px" class="parameters_name">
|
jpayne@68
|
355 <col class="parameters_description">
|
jpayne@68
|
356 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
357 </colgroup>
|
jpayne@68
|
358 <tbody><tr>
|
jpayne@68
|
359 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
360 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
361 <td class="parameter_annotations"> </td>
|
jpayne@68
|
362 </tr></tbody>
|
jpayne@68
|
363 </table></div>
|
jpayne@68
|
364 </div>
|
jpayne@68
|
365 <div class="refsect3">
|
jpayne@68
|
366 <a name="cairo-device-status.returns"></a><h4>Returns</h4>
|
jpayne@68
|
367 <p> <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> on success or an error code if
|
jpayne@68
|
368 the device is in an error state.</p>
|
jpayne@68
|
369 </div>
|
jpayne@68
|
370 <p class="since">Since: 1.10</p>
|
jpayne@68
|
371 </div>
|
jpayne@68
|
372 <hr>
|
jpayne@68
|
373 <div class="refsect2">
|
jpayne@68
|
374 <a name="cairo-device-finish"></a><h3>cairo_device_finish ()</h3>
|
jpayne@68
|
375 <pre class="programlisting"><span class="returnvalue">void</span>
|
jpayne@68
|
376 cairo_device_finish (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
377 <p>This function finishes the device and drops all references to
|
jpayne@68
|
378 external resources. All surfaces, fonts and other objects created
|
jpayne@68
|
379 for this <em class="parameter"><code>device</code></em>
|
jpayne@68
|
380 will be finished, too.
|
jpayne@68
|
381 Further operations on the <em class="parameter"><code>device</code></em>
|
jpayne@68
|
382 will not affect the <em class="parameter"><code>device</code></em>
|
jpayne@68
|
383 but
|
jpayne@68
|
384 will instead trigger a <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-DEVICE-FINISHED:CAPS"><code class="literal">CAIRO_STATUS_DEVICE_FINISHED</code></a> error.</p>
|
jpayne@68
|
385 <p>When the last call to <a class="link" href="cairo-cairo-device-t.html#cairo-device-destroy" title="cairo_device_destroy ()"><code class="function">cairo_device_destroy()</code></a> decreases the
|
jpayne@68
|
386 reference count to zero, cairo will call <a class="link" href="cairo-cairo-device-t.html#cairo-device-finish" title="cairo_device_finish ()"><code class="function">cairo_device_finish()</code></a> if
|
jpayne@68
|
387 it hasn't been called already, before freeing the resources
|
jpayne@68
|
388 associated with the device.</p>
|
jpayne@68
|
389 <p>This function may acquire devices.</p>
|
jpayne@68
|
390 <div class="refsect3">
|
jpayne@68
|
391 <a name="cairo-device-finish.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
392 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
393 <colgroup>
|
jpayne@68
|
394 <col width="150px" class="parameters_name">
|
jpayne@68
|
395 <col class="parameters_description">
|
jpayne@68
|
396 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
397 </colgroup>
|
jpayne@68
|
398 <tbody><tr>
|
jpayne@68
|
399 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
400 <td class="parameter_description"><p>the <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> to finish</p></td>
|
jpayne@68
|
401 <td class="parameter_annotations"> </td>
|
jpayne@68
|
402 </tr></tbody>
|
jpayne@68
|
403 </table></div>
|
jpayne@68
|
404 </div>
|
jpayne@68
|
405 <p class="since">Since: 1.10</p>
|
jpayne@68
|
406 </div>
|
jpayne@68
|
407 <hr>
|
jpayne@68
|
408 <div class="refsect2">
|
jpayne@68
|
409 <a name="cairo-device-flush"></a><h3>cairo_device_flush ()</h3>
|
jpayne@68
|
410 <pre class="programlisting"><span class="returnvalue">void</span>
|
jpayne@68
|
411 cairo_device_flush (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
412 <p>Finish any pending operations for the device and also restore any
|
jpayne@68
|
413 temporary modifications cairo has made to the device's state.
|
jpayne@68
|
414 This function must be called before switching from using the
|
jpayne@68
|
415 device with Cairo to operating on it directly with native APIs.
|
jpayne@68
|
416 If the device doesn't support direct access, then this function
|
jpayne@68
|
417 does nothing.</p>
|
jpayne@68
|
418 <p>This function may acquire devices.</p>
|
jpayne@68
|
419 <div class="refsect3">
|
jpayne@68
|
420 <a name="cairo-device-flush.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
421 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
422 <colgroup>
|
jpayne@68
|
423 <col width="150px" class="parameters_name">
|
jpayne@68
|
424 <col class="parameters_description">
|
jpayne@68
|
425 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
426 </colgroup>
|
jpayne@68
|
427 <tbody><tr>
|
jpayne@68
|
428 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
429 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
430 <td class="parameter_annotations"> </td>
|
jpayne@68
|
431 </tr></tbody>
|
jpayne@68
|
432 </table></div>
|
jpayne@68
|
433 </div>
|
jpayne@68
|
434 <p class="since">Since: 1.10</p>
|
jpayne@68
|
435 </div>
|
jpayne@68
|
436 <hr>
|
jpayne@68
|
437 <div class="refsect2">
|
jpayne@68
|
438 <a name="cairo-device-get-type"></a><h3>cairo_device_get_type ()</h3>
|
jpayne@68
|
439 <pre class="programlisting"><a class="link" href="cairo-cairo-device-t.html#cairo-device-type-t" title="enum cairo_device_type_t"><span class="returnvalue">cairo_device_type_t</span></a>
|
jpayne@68
|
440 cairo_device_get_type (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
441 <p>This function returns the type of the device. See <a class="link" href="cairo-cairo-device-t.html#cairo-device-type-t" title="enum cairo_device_type_t"><span class="type">cairo_device_type_t</span></a>
|
jpayne@68
|
442 for available types.</p>
|
jpayne@68
|
443 <div class="refsect3">
|
jpayne@68
|
444 <a name="cairo-device-get-type.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
445 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
446 <colgroup>
|
jpayne@68
|
447 <col width="150px" class="parameters_name">
|
jpayne@68
|
448 <col class="parameters_description">
|
jpayne@68
|
449 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
450 </colgroup>
|
jpayne@68
|
451 <tbody><tr>
|
jpayne@68
|
452 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
453 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
454 <td class="parameter_annotations"> </td>
|
jpayne@68
|
455 </tr></tbody>
|
jpayne@68
|
456 </table></div>
|
jpayne@68
|
457 </div>
|
jpayne@68
|
458 <div class="refsect3">
|
jpayne@68
|
459 <a name="cairo-device-get-type.returns"></a><h4>Returns</h4>
|
jpayne@68
|
460 <p> The type of <em class="parameter"><code>device</code></em>
|
jpayne@68
|
461 .</p>
|
jpayne@68
|
462 </div>
|
jpayne@68
|
463 <p class="since">Since: 1.10</p>
|
jpayne@68
|
464 </div>
|
jpayne@68
|
465 <hr>
|
jpayne@68
|
466 <div class="refsect2">
|
jpayne@68
|
467 <a name="cairo-device-get-reference-count"></a><h3>cairo_device_get_reference_count ()</h3>
|
jpayne@68
|
468 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
|
jpayne@68
|
469 cairo_device_get_reference_count (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
470 <p>Returns the current reference count of <em class="parameter"><code>device</code></em>
|
jpayne@68
|
471 .</p>
|
jpayne@68
|
472 <div class="refsect3">
|
jpayne@68
|
473 <a name="cairo-device-get-reference-count.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
474 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
475 <colgroup>
|
jpayne@68
|
476 <col width="150px" class="parameters_name">
|
jpayne@68
|
477 <col class="parameters_description">
|
jpayne@68
|
478 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
479 </colgroup>
|
jpayne@68
|
480 <tbody><tr>
|
jpayne@68
|
481 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
482 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
483 <td class="parameter_annotations"> </td>
|
jpayne@68
|
484 </tr></tbody>
|
jpayne@68
|
485 </table></div>
|
jpayne@68
|
486 </div>
|
jpayne@68
|
487 <div class="refsect3">
|
jpayne@68
|
488 <a name="cairo-device-get-reference-count.returns"></a><h4>Returns</h4>
|
jpayne@68
|
489 <p> the current reference count of <em class="parameter"><code>device</code></em>
|
jpayne@68
|
490 . If the
|
jpayne@68
|
491 object is a nil object, 0 will be returned.</p>
|
jpayne@68
|
492 </div>
|
jpayne@68
|
493 <p class="since">Since: 1.10</p>
|
jpayne@68
|
494 </div>
|
jpayne@68
|
495 <hr>
|
jpayne@68
|
496 <div class="refsect2">
|
jpayne@68
|
497 <a name="cairo-device-set-user-data"></a><h3>cairo_device_set_user_data ()</h3>
|
jpayne@68
|
498 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
499 cairo_device_set_user_data (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>,
|
jpayne@68
|
500 <em class="parameter"><code>const <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t"><span class="type">cairo_user_data_key_t</span></a> *key</code></em>,
|
jpayne@68
|
501 <em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
|
jpayne@68
|
502 <em class="parameter"><code><a class="link" href="cairo-Types.html#cairo-destroy-func-t" title="cairo_destroy_func_t ()"><span class="type">cairo_destroy_func_t</span></a> destroy</code></em>);</pre>
|
jpayne@68
|
503 <p>Attach user data to <em class="parameter"><code>device</code></em>
|
jpayne@68
|
504 . To remove user data from a surface,
|
jpayne@68
|
505 call this function with the key that was used to set it and <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
|
jpayne@68
|
506 for <em class="parameter"><code>data</code></em>
|
jpayne@68
|
507 .</p>
|
jpayne@68
|
508 <div class="refsect3">
|
jpayne@68
|
509 <a name="cairo-device-set-user-data.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
510 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
511 <colgroup>
|
jpayne@68
|
512 <col width="150px" class="parameters_name">
|
jpayne@68
|
513 <col class="parameters_description">
|
jpayne@68
|
514 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
515 </colgroup>
|
jpayne@68
|
516 <tbody>
|
jpayne@68
|
517 <tr>
|
jpayne@68
|
518 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
519 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
520 <td class="parameter_annotations"> </td>
|
jpayne@68
|
521 </tr>
|
jpayne@68
|
522 <tr>
|
jpayne@68
|
523 <td class="parameter_name"><p>key</p></td>
|
jpayne@68
|
524 <td class="parameter_description"><p>the address of a <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t"><span class="type">cairo_user_data_key_t</span></a> to attach the user data to</p></td>
|
jpayne@68
|
525 <td class="parameter_annotations"> </td>
|
jpayne@68
|
526 </tr>
|
jpayne@68
|
527 <tr>
|
jpayne@68
|
528 <td class="parameter_name"><p>user_data</p></td>
|
jpayne@68
|
529 <td class="parameter_description"><p>the user data to attach to the <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
530 <td class="parameter_annotations"> </td>
|
jpayne@68
|
531 </tr>
|
jpayne@68
|
532 <tr>
|
jpayne@68
|
533 <td class="parameter_name"><p>destroy</p></td>
|
jpayne@68
|
534 <td class="parameter_description"><p>a <a class="link" href="cairo-Types.html#cairo-destroy-func-t" title="cairo_destroy_func_t ()"><span class="type">cairo_destroy_func_t</span></a> which will be called when the
|
jpayne@68
|
535 <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> is destroyed or when new user data is attached using the
|
jpayne@68
|
536 same key.</p></td>
|
jpayne@68
|
537 <td class="parameter_annotations"> </td>
|
jpayne@68
|
538 </tr>
|
jpayne@68
|
539 </tbody>
|
jpayne@68
|
540 </table></div>
|
jpayne@68
|
541 </div>
|
jpayne@68
|
542 <div class="refsect3">
|
jpayne@68
|
543 <a name="cairo-device-set-user-data.returns"></a><h4>Returns</h4>
|
jpayne@68
|
544 <p> <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> or <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a> if a
|
jpayne@68
|
545 slot could not be allocated for the user data.</p>
|
jpayne@68
|
546 </div>
|
jpayne@68
|
547 <p class="since">Since: 1.10</p>
|
jpayne@68
|
548 </div>
|
jpayne@68
|
549 <hr>
|
jpayne@68
|
550 <div class="refsect2">
|
jpayne@68
|
551 <a name="cairo-device-get-user-data"></a><h3>cairo_device_get_user_data ()</h3>
|
jpayne@68
|
552 <pre class="programlisting"><span class="returnvalue">void</span> *
|
jpayne@68
|
553 cairo_device_get_user_data (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>,
|
jpayne@68
|
554 <em class="parameter"><code>const <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t"><span class="type">cairo_user_data_key_t</span></a> *key</code></em>);</pre>
|
jpayne@68
|
555 <p>Return user data previously attached to <em class="parameter"><code>device</code></em>
|
jpayne@68
|
556 using the
|
jpayne@68
|
557 specified key. If no user data has been attached with the given
|
jpayne@68
|
558 key this function returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
|
jpayne@68
|
559 <div class="refsect3">
|
jpayne@68
|
560 <a name="cairo-device-get-user-data.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
561 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
562 <colgroup>
|
jpayne@68
|
563 <col width="150px" class="parameters_name">
|
jpayne@68
|
564 <col class="parameters_description">
|
jpayne@68
|
565 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
566 </colgroup>
|
jpayne@68
|
567 <tbody>
|
jpayne@68
|
568 <tr>
|
jpayne@68
|
569 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
570 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
571 <td class="parameter_annotations"> </td>
|
jpayne@68
|
572 </tr>
|
jpayne@68
|
573 <tr>
|
jpayne@68
|
574 <td class="parameter_name"><p>key</p></td>
|
jpayne@68
|
575 <td class="parameter_description"><p>the address of the <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t"><span class="type">cairo_user_data_key_t</span></a> the user data was
|
jpayne@68
|
576 attached to</p></td>
|
jpayne@68
|
577 <td class="parameter_annotations"> </td>
|
jpayne@68
|
578 </tr>
|
jpayne@68
|
579 </tbody>
|
jpayne@68
|
580 </table></div>
|
jpayne@68
|
581 </div>
|
jpayne@68
|
582 <div class="refsect3">
|
jpayne@68
|
583 <a name="cairo-device-get-user-data.returns"></a><h4>Returns</h4>
|
jpayne@68
|
584 <p> the user data previously attached or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
|
jpayne@68
|
585 </div>
|
jpayne@68
|
586 <p class="since">Since: 1.10</p>
|
jpayne@68
|
587 </div>
|
jpayne@68
|
588 <hr>
|
jpayne@68
|
589 <div class="refsect2">
|
jpayne@68
|
590 <a name="cairo-device-acquire"></a><h3>cairo_device_acquire ()</h3>
|
jpayne@68
|
591 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
592 cairo_device_acquire (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
593 <p>Acquires the <em class="parameter"><code>device</code></em>
|
jpayne@68
|
594 for the current thread. This function will block
|
jpayne@68
|
595 until no other thread has acquired the device.</p>
|
jpayne@68
|
596 <p>If the return value is <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, you successfully acquired the
|
jpayne@68
|
597 device. From now on your thread owns the device and no other thread will be
|
jpayne@68
|
598 able to acquire it until a matching call to <a class="link" href="cairo-cairo-device-t.html#cairo-device-release" title="cairo_device_release ()"><code class="function">cairo_device_release()</code></a>. It is
|
jpayne@68
|
599 allowed to recursively acquire the device multiple times from the same
|
jpayne@68
|
600 thread.</p>
|
jpayne@68
|
601 <div class="note"><p>You must never acquire two different devices at the same time
|
jpayne@68
|
602 unless this is explicitly allowed. Otherwise the possibility of deadlocks
|
jpayne@68
|
603 exist.
|
jpayne@68
|
604
|
jpayne@68
|
605 As various Cairo functions can acquire devices when called, these functions
|
jpayne@68
|
606 may also cause deadlocks when you call them with an acquired device. So you
|
jpayne@68
|
607 must not have a device acquired when calling them. These functions are
|
jpayne@68
|
608 marked in the documentation.
|
jpayne@68
|
609 </p></div>
|
jpayne@68
|
610 <div class="refsect3">
|
jpayne@68
|
611 <a name="cairo-device-acquire.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
612 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
613 <colgroup>
|
jpayne@68
|
614 <col width="150px" class="parameters_name">
|
jpayne@68
|
615 <col class="parameters_description">
|
jpayne@68
|
616 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
617 </colgroup>
|
jpayne@68
|
618 <tbody><tr>
|
jpayne@68
|
619 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
620 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
621 <td class="parameter_annotations"> </td>
|
jpayne@68
|
622 </tr></tbody>
|
jpayne@68
|
623 </table></div>
|
jpayne@68
|
624 </div>
|
jpayne@68
|
625 <div class="refsect3">
|
jpayne@68
|
626 <a name="cairo-device-acquire.returns"></a><h4>Returns</h4>
|
jpayne@68
|
627 <p> <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> on success or an error code if
|
jpayne@68
|
628 the device is in an error state and could not be
|
jpayne@68
|
629 acquired. After a successful call to <a class="link" href="cairo-cairo-device-t.html#cairo-device-acquire" title="cairo_device_acquire ()"><code class="function">cairo_device_acquire()</code></a>,
|
jpayne@68
|
630 a matching call to <a class="link" href="cairo-cairo-device-t.html#cairo-device-release" title="cairo_device_release ()"><code class="function">cairo_device_release()</code></a> is required.</p>
|
jpayne@68
|
631 </div>
|
jpayne@68
|
632 <p class="since">Since: 1.10</p>
|
jpayne@68
|
633 </div>
|
jpayne@68
|
634 <hr>
|
jpayne@68
|
635 <div class="refsect2">
|
jpayne@68
|
636 <a name="cairo-device-release"></a><h3>cairo_device_release ()</h3>
|
jpayne@68
|
637 <pre class="programlisting"><span class="returnvalue">void</span>
|
jpayne@68
|
638 cairo_device_release (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
639 <p>Releases a <em class="parameter"><code>device</code></em>
|
jpayne@68
|
640 previously acquired using <a class="link" href="cairo-cairo-device-t.html#cairo-device-acquire" title="cairo_device_acquire ()"><code class="function">cairo_device_acquire()</code></a>. See
|
jpayne@68
|
641 that function for details.</p>
|
jpayne@68
|
642 <div class="refsect3">
|
jpayne@68
|
643 <a name="cairo-device-release.parameters"></a><h4>Parameters</h4>
|
jpayne@68
|
644 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
645 <colgroup>
|
jpayne@68
|
646 <col width="150px" class="parameters_name">
|
jpayne@68
|
647 <col class="parameters_description">
|
jpayne@68
|
648 <col width="200px" class="parameters_annotations">
|
jpayne@68
|
649 </colgroup>
|
jpayne@68
|
650 <tbody><tr>
|
jpayne@68
|
651 <td class="parameter_name"><p>device</p></td>
|
jpayne@68
|
652 <td class="parameter_description"><p>a <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a></p></td>
|
jpayne@68
|
653 <td class="parameter_annotations"> </td>
|
jpayne@68
|
654 </tr></tbody>
|
jpayne@68
|
655 </table></div>
|
jpayne@68
|
656 </div>
|
jpayne@68
|
657 <p class="since">Since: 1.10</p>
|
jpayne@68
|
658 </div>
|
jpayne@68
|
659 <hr>
|
jpayne@68
|
660 <div class="refsect2">
|
jpayne@68
|
661 <a name="cairo-device-observer-elapsed"></a><h3>cairo_device_observer_elapsed ()</h3>
|
jpayne@68
|
662 <pre class="programlisting"><span class="returnvalue">double</span>
|
jpayne@68
|
663 cairo_device_observer_elapsed (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
664 </div>
|
jpayne@68
|
665 <hr>
|
jpayne@68
|
666 <div class="refsect2">
|
jpayne@68
|
667 <a name="cairo-device-observer-fill-elapsed"></a><h3>cairo_device_observer_fill_elapsed ()</h3>
|
jpayne@68
|
668 <pre class="programlisting"><span class="returnvalue">double</span>
|
jpayne@68
|
669 cairo_device_observer_fill_elapsed (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
670 </div>
|
jpayne@68
|
671 <hr>
|
jpayne@68
|
672 <div class="refsect2">
|
jpayne@68
|
673 <a name="cairo-device-observer-glyphs-elapsed"></a><h3>cairo_device_observer_glyphs_elapsed ()</h3>
|
jpayne@68
|
674 <pre class="programlisting"><span class="returnvalue">double</span>
|
jpayne@68
|
675 cairo_device_observer_glyphs_elapsed (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
676 </div>
|
jpayne@68
|
677 <hr>
|
jpayne@68
|
678 <div class="refsect2">
|
jpayne@68
|
679 <a name="cairo-device-observer-mask-elapsed"></a><h3>cairo_device_observer_mask_elapsed ()</h3>
|
jpayne@68
|
680 <pre class="programlisting"><span class="returnvalue">double</span>
|
jpayne@68
|
681 cairo_device_observer_mask_elapsed (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
682 </div>
|
jpayne@68
|
683 <hr>
|
jpayne@68
|
684 <div class="refsect2">
|
jpayne@68
|
685 <a name="cairo-device-observer-paint-elapsed"></a><h3>cairo_device_observer_paint_elapsed ()</h3>
|
jpayne@68
|
686 <pre class="programlisting"><span class="returnvalue">double</span>
|
jpayne@68
|
687 cairo_device_observer_paint_elapsed (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
688 </div>
|
jpayne@68
|
689 <hr>
|
jpayne@68
|
690 <div class="refsect2">
|
jpayne@68
|
691 <a name="cairo-device-observer-print"></a><h3>cairo_device_observer_print ()</h3>
|
jpayne@68
|
692 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
|
jpayne@68
|
693 cairo_device_observer_print (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>,
|
jpayne@68
|
694 <em class="parameter"><code><a class="link" href="cairo-PNG-Support.html#cairo-write-func-t" title="cairo_write_func_t ()"><span class="type">cairo_write_func_t</span></a> write_func</code></em>,
|
jpayne@68
|
695 <em class="parameter"><code><span class="type">void</span> *closure</code></em>);</pre>
|
jpayne@68
|
696 </div>
|
jpayne@68
|
697 <hr>
|
jpayne@68
|
698 <div class="refsect2">
|
jpayne@68
|
699 <a name="cairo-device-observer-stroke-elapsed"></a><h3>cairo_device_observer_stroke_elapsed ()</h3>
|
jpayne@68
|
700 <pre class="programlisting"><span class="returnvalue">double</span>
|
jpayne@68
|
701 cairo_device_observer_stroke_elapsed (<em class="parameter"><code><a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> *device</code></em>);</pre>
|
jpayne@68
|
702 </div>
|
jpayne@68
|
703 </div>
|
jpayne@68
|
704 <div class="refsect1">
|
jpayne@68
|
705 <a name="cairo-cairo-device-t.other_details"></a><h2>Types and Values</h2>
|
jpayne@68
|
706 <div class="refsect2">
|
jpayne@68
|
707 <a name="cairo-device-t"></a><h3>cairo_device_t</h3>
|
jpayne@68
|
708 <pre class="programlisting">typedef struct _cairo_device cairo_device_t;
|
jpayne@68
|
709 </pre>
|
jpayne@68
|
710 <p>A <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> represents the driver interface for drawing
|
jpayne@68
|
711 operations to a <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a>. There are different subtypes of
|
jpayne@68
|
712 <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> for different drawing backends; for example,
|
jpayne@68
|
713 <code class="function">cairo_egl_device_create()</code> creates a device that wraps an EGL display and
|
jpayne@68
|
714 context.</p>
|
jpayne@68
|
715 <p>The type of a device can be queried with <a class="link" href="cairo-cairo-device-t.html#cairo-device-get-type" title="cairo_device_get_type ()"><code class="function">cairo_device_get_type()</code></a>.</p>
|
jpayne@68
|
716 <p>Memory management of <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> is done with
|
jpayne@68
|
717 <a class="link" href="cairo-cairo-device-t.html#cairo-device-reference" title="cairo_device_reference ()"><code class="function">cairo_device_reference()</code></a> and <a class="link" href="cairo-cairo-device-t.html#cairo-device-destroy" title="cairo_device_destroy ()"><code class="function">cairo_device_destroy()</code></a>.</p>
|
jpayne@68
|
718 <p class="since">Since: 1.10</p>
|
jpayne@68
|
719 </div>
|
jpayne@68
|
720 <hr>
|
jpayne@68
|
721 <div class="refsect2">
|
jpayne@68
|
722 <a name="cairo-device-type-t"></a><h3>enum cairo_device_type_t</h3>
|
jpayne@68
|
723 <p><a class="link" href="cairo-cairo-device-t.html#cairo-device-type-t" title="enum cairo_device_type_t"><span class="type">cairo_device_type_t</span></a> is used to describe the type of a given
|
jpayne@68
|
724 device. The devices types are also known as "backends" within cairo.</p>
|
jpayne@68
|
725 <p>The device type can be queried with <a class="link" href="cairo-cairo-device-t.html#cairo-device-get-type" title="cairo_device_get_type ()"><code class="function">cairo_device_get_type()</code></a></p>
|
jpayne@68
|
726 <p>The various <a class="link" href="cairo-cairo-device-t.html#cairo-device-t" title="cairo_device_t"><span class="type">cairo_device_t</span></a> functions can be used with devices of
|
jpayne@68
|
727 any type, but some backends also provide type-specific functions
|
jpayne@68
|
728 that must only be called with a device of the appropriate
|
jpayne@68
|
729 type. These functions have names that begin with
|
jpayne@68
|
730 <code class="literal">cairo_<span class="emphasis"><em>type</em></span>_device</code> such as
|
jpayne@68
|
731 <a class="link" href="cairo-XCB-Surfaces.html#cairo-xcb-device-debug-cap-xrender-version" title="cairo_xcb_device_debug_cap_xrender_version ()"><code class="function">cairo_xcb_device_debug_cap_xrender_version()</code></a>.</p>
|
jpayne@68
|
732 <p>The behavior of calling a type-specific function with a device of
|
jpayne@68
|
733 the wrong type is undefined.</p>
|
jpayne@68
|
734 <p>New entries may be added in future versions.</p>
|
jpayne@68
|
735 <div class="refsect3">
|
jpayne@68
|
736 <a name="cairo-device-type-t.members"></a><h4>Members</h4>
|
jpayne@68
|
737 <div class="informaltable"><table class="informaltable" width="100%" border="0">
|
jpayne@68
|
738 <colgroup>
|
jpayne@68
|
739 <col width="300px" class="enum_members_name">
|
jpayne@68
|
740 <col class="enum_members_description">
|
jpayne@68
|
741 <col width="200px" class="enum_members_annotations">
|
jpayne@68
|
742 </colgroup>
|
jpayne@68
|
743 <tbody>
|
jpayne@68
|
744 <tr>
|
jpayne@68
|
745 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-DRM:CAPS"></a>CAIRO_DEVICE_TYPE_DRM</p></td>
|
jpayne@68
|
746 <td class="enum_member_description">
|
jpayne@68
|
747 <p>The device is of type Direct Render Manager, since 1.10</p>
|
jpayne@68
|
748 </td>
|
jpayne@68
|
749 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
750 </tr>
|
jpayne@68
|
751 <tr>
|
jpayne@68
|
752 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-GL:CAPS"></a>CAIRO_DEVICE_TYPE_GL</p></td>
|
jpayne@68
|
753 <td class="enum_member_description">
|
jpayne@68
|
754 <p>The device is of type OpenGL, since 1.10</p>
|
jpayne@68
|
755 </td>
|
jpayne@68
|
756 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
757 </tr>
|
jpayne@68
|
758 <tr>
|
jpayne@68
|
759 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-SCRIPT:CAPS"></a>CAIRO_DEVICE_TYPE_SCRIPT</p></td>
|
jpayne@68
|
760 <td class="enum_member_description">
|
jpayne@68
|
761 <p>The device is of type script, since 1.10</p>
|
jpayne@68
|
762 </td>
|
jpayne@68
|
763 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
764 </tr>
|
jpayne@68
|
765 <tr>
|
jpayne@68
|
766 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-XCB:CAPS"></a>CAIRO_DEVICE_TYPE_XCB</p></td>
|
jpayne@68
|
767 <td class="enum_member_description">
|
jpayne@68
|
768 <p>The device is of type xcb, since 1.10</p>
|
jpayne@68
|
769 </td>
|
jpayne@68
|
770 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
771 </tr>
|
jpayne@68
|
772 <tr>
|
jpayne@68
|
773 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-XLIB:CAPS"></a>CAIRO_DEVICE_TYPE_XLIB</p></td>
|
jpayne@68
|
774 <td class="enum_member_description">
|
jpayne@68
|
775 <p>The device is of type xlib, since 1.10</p>
|
jpayne@68
|
776 </td>
|
jpayne@68
|
777 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
778 </tr>
|
jpayne@68
|
779 <tr>
|
jpayne@68
|
780 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-XML:CAPS"></a>CAIRO_DEVICE_TYPE_XML</p></td>
|
jpayne@68
|
781 <td class="enum_member_description">
|
jpayne@68
|
782 <p>The device is of type XML, since 1.10</p>
|
jpayne@68
|
783 </td>
|
jpayne@68
|
784 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
785 </tr>
|
jpayne@68
|
786 <tr>
|
jpayne@68
|
787 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-COGL:CAPS"></a>CAIRO_DEVICE_TYPE_COGL</p></td>
|
jpayne@68
|
788 <td class="enum_member_description">
|
jpayne@68
|
789 <p>The device is of type cogl, since 1.12</p>
|
jpayne@68
|
790 </td>
|
jpayne@68
|
791 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
792 </tr>
|
jpayne@68
|
793 <tr>
|
jpayne@68
|
794 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-WIN32:CAPS"></a>CAIRO_DEVICE_TYPE_WIN32</p></td>
|
jpayne@68
|
795 <td class="enum_member_description">
|
jpayne@68
|
796 <p>The device is of type win32, since 1.12</p>
|
jpayne@68
|
797 </td>
|
jpayne@68
|
798 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
799 </tr>
|
jpayne@68
|
800 <tr>
|
jpayne@68
|
801 <td class="enum_member_name"><p><a name="CAIRO-DEVICE-TYPE-INVALID:CAPS"></a>CAIRO_DEVICE_TYPE_INVALID</p></td>
|
jpayne@68
|
802 <td class="enum_member_description">
|
jpayne@68
|
803 <p>The device is invalid, since 1.10</p>
|
jpayne@68
|
804 </td>
|
jpayne@68
|
805 <td class="enum_member_annotations"> </td>
|
jpayne@68
|
806 </tr>
|
jpayne@68
|
807 </tbody>
|
jpayne@68
|
808 </table></div>
|
jpayne@68
|
809 </div>
|
jpayne@68
|
810 <p class="since">Since: 1.10</p>
|
jpayne@68
|
811 </div>
|
jpayne@68
|
812 </div>
|
jpayne@68
|
813 <div class="refsect1">
|
jpayne@68
|
814 <a name="cairo-cairo-device-t.see-also"></a><h2>See Also</h2>
|
jpayne@68
|
815 <p><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a></p>
|
jpayne@68
|
816 </div>
|
jpayne@68
|
817 </div>
|
jpayne@68
|
818 <div class="footer">
|
jpayne@68
|
819 <hr>Generated by GTK-Doc V1.27</div>
|
jpayne@68
|
820 </body>
|
jpayne@68
|
821 </html> |