File: classCairo_1_1Device.html

package info (click to toggle)
cairomm 1.10.0-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 5,496 kB
  • sloc: sh: 10,127; cpp: 5,652; perl: 236; makefile: 157
file content (341 lines) | stat: -rw-r--r-- 20,805 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
        <title>cairomm: Cairo::Device Class Reference</title>
        <link href="cairomm.css" rel="stylesheet" type="text/css">
    </head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceCairo.html">Cairo</a> </li>
      <li class="navelem"><a class="el" href="classCairo_1_1Device.html">Device</a> </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> </div>
  <div class="headertitle">
<h1>Cairo::Device Class Reference</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="Cairo::Device" -->
<p>Devices are the abstraction <a class="el" href="namespaceCairo.html">Cairo</a> employs for the rendering system used by a cairo_surface_t. <a href="#_details">More...</a></p>

<p><a href="classCairo_1_1Device-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device_1_1Lock.html">Lock</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A convenience class for acquiring a <a class="el" href="classCairo_1_1Device.html" title="Devices are the abstraction Cairo employs for the rendering system used by a cairo_surface_t.">Device</a> object in an exception-safe manner. <a href="classCairo_1_1Device_1_1Lock.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef cairo_device_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#aec567647cc3675369f49fdcc469c6132">Device</a> (cairo_device_t*<a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a>, bool has_reference=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a C++ wrapper for the C instance. <a href="#aec567647cc3675369f49fdcc469c6132"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a94fd2ef7446a1653e7e7a8e2642ec826">~Device</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceCairo.html#acd6c59cfdf7e4c9df93011f5dcf9b55c">DeviceType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a73a80a27c988f840701272fd571f9b5d">get_type</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the type of the device. <a href="#a73a80a27c988f840701272fd571f9b5d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a8c41a4a0a95d25fa60012036d165abd9">flush</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Finish any pending operations for the device and also restore any temporary modifications cairo has made to the device's state. <a href="#a8c41a4a0a95d25fa60012036d165abd9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#afe9262cdb04d7ec3f58d48333d1898f5">finish</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function finishes the device and drops all references to external resources. <a href="#afe9262cdb04d7ec3f58d48333d1898f5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#aedd60074545b2d744fda80fde40bfb79">acquire</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquires the device for the current thread. <a href="#aedd60074545b2d744fda80fde40bfb79"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a044504de9e04b01d52a65521f48c0556">release</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases a device previously acquired using <a class="el" href="classCairo_1_1Device.html#aedd60074545b2d744fda80fde40bfb79" title="Acquires the device for the current thread.">acquire()</a>. <a href="#a044504de9e04b01d52a65521f48c0556"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a>*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#af460646f6002455f842ad763051bc86c">cobj</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a>*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#ad873aed7e520543740e1b886668dd568">cobj</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a5f5bce224e01fa9fc98306361ae4e14f">reference</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a633b0e213b716ff4427f00025f53477f">unreference</a> () const </td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a>*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Device.html#a2252dec9ccb0905a5b74491d4b09315d">m_cobject</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Devices are the abstraction <a class="el" href="namespaceCairo.html">Cairo</a> employs for the rendering system used by a cairo_surface_t. </p>
<p>You can get the device of a surface using <a class="el" href="classCairo_1_1Surface.html#a3d1f19c2210e0e7a4aa3d3053b90107f" title="This function returns the device for a surface.">Surface::get_device()</a>.</p>
<p>Devices are created using custom functions specific to the rendering system you want to use. See the documentation for the surface types for those functions.</p>
<p>An important function that devices fulfill is sharing access to the rendering system between <a class="el" href="namespaceCairo.html">Cairo</a> and your application. If you want to access a device directly that you used to draw to with <a class="el" href="namespaceCairo.html">Cairo</a>, you must first call <a class="el" href="classCairo_1_1Device.html#a8c41a4a0a95d25fa60012036d165abd9" title="Finish any pending operations for the device and also restore any temporary modifications cairo has m...">flush()</a> to ensure that <a class="el" href="namespaceCairo.html">Cairo</a> finishes all operations on the device and resets it to a clean state.</p>
<p><a class="el" href="namespaceCairo.html">Cairo</a> also provides the functions <a class="el" href="classCairo_1_1Device.html#aedd60074545b2d744fda80fde40bfb79" title="Acquires the device for the current thread.">acquire()</a> and <a class="el" href="classCairo_1_1Device.html#a044504de9e04b01d52a65521f48c0556" title="Releases a device previously acquired using acquire().">release()</a> to synchronize access to the rendering system in a multithreaded environment. This is done internally, but can also be used by applications. There is also a <a class="el" href="classCairo_1_1Device_1_1Lock.html" title="A convenience class for acquiring a Device object in an exception-safe manner.">Device::Lock</a> convenience class that allows the device to be acquired and released in an exception-safe manner.</p>
<p>This is a reference-counted object that should be used via <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">Cairo::RefPtr</a>. </p>
</div><hr/><h2>Member Typedef Documentation</h2>
<a class="anchor" id="a327c8a8ac39f484f68a550ae34f82411"></a><!-- doxytag: member="Cairo::Device::cobject" ref="a327c8a8ac39f484f68a550ae34f82411" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef cairo_device_t <a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">Cairo::Device::cobject</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aec567647cc3675369f49fdcc469c6132"></a><!-- doxytag: member="Cairo::Device::Device" ref="aec567647cc3675369f49fdcc469c6132" args="(cairo_device_t *cobject, bool has_reference=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cairo::Device::Device </td>
          <td>(</td>
          <td class="paramtype">cairo_device_t *&#160;</td>
          <td class="paramname"><em>cobject</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>has_reference</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a C++ wrapper for the C instance. </p>
<p>This C++ instance should then be given to a <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">RefPtr</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">cobject</td><td>The C instance. </td></tr>
    <tr><td class="paramname">has_reference</td><td>Whether we already have a reference. Otherwise, the constructor will take an extra reference. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a94fd2ef7446a1653e7e7a8e2642ec826"></a><!-- doxytag: member="Cairo::Device::~Device" ref="a94fd2ef7446a1653e7e7a8e2642ec826" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual Cairo::Device::~Device </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aedd60074545b2d744fda80fde40bfb79"></a><!-- doxytag: member="Cairo::Device::acquire" ref="aedd60074545b2d744fda80fde40bfb79" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cairo::Device::acquire </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Acquires the device for the current thread. </p>
<p>This function will block until no other thread has acquired the device.</p>
<p>If no exception is thrown, you successfully acquired the device. From now on your thread owns the device and no other thread will be able to acquire it until a matching call to <a class="el" href="classCairo_1_1Device.html#a044504de9e04b01d52a65521f48c0556" title="Releases a device previously acquired using acquire().">release()</a>. It is allowed to recursively acquire the device multiple times from the same thread.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>It is recommended to use <a class="el" href="classCairo_1_1Device_1_1Lock.html" title="A convenience class for acquiring a Device object in an exception-safe manner.">Device::Lock</a> to acquire devices in an exception-safe manner, rather than acquiring and releasing the device manually.</dd></dl>
<dl class="warning"><dt><b>Warning:</b></dt><dd>You must never acquire two different devices at the same time unless this is explicitly allowed. Otherwise the possibility of deadlocks exist.</dd>
<dd>
As various <a class="el" href="namespaceCairo.html">Cairo</a> functions can acquire devices when called, these functions may also cause deadlocks when you call them with an acquired device. So you must not have a device acquired when calling them. These functions are marked in the documentation. </dd></dl>

</div>
</div>
<a class="anchor" id="af460646f6002455f842ad763051bc86c"></a><!-- doxytag: member="Cairo::Device::cobj" ref="af460646f6002455f842ad763051bc86c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a>* Cairo::Device::cobj </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ad873aed7e520543740e1b886668dd568"></a><!-- doxytag: member="Cairo::Device::cobj" ref="ad873aed7e520543740e1b886668dd568" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a>* Cairo::Device::cobj </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="afe9262cdb04d7ec3f58d48333d1898f5"></a><!-- doxytag: member="Cairo::Device::finish" ref="afe9262cdb04d7ec3f58d48333d1898f5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cairo::Device::finish </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This function finishes the device and drops all references to external resources. </p>
<p>All surfaces, fonts and other objects created for this device will be finished, too. Further operations on the device will not affect the device but will instead trigger a DEVICE_FINISHED error.</p>
<p>When the last reference to the device is dropped, cairo will call <a class="el" href="classCairo_1_1Device.html#afe9262cdb04d7ec3f58d48333d1898f5" title="This function finishes the device and drops all references to external resources.">finish()</a> if it hasn't been called already, before freeing the resources associated with the device.</p>
<p>This function may acquire devices. </p>

</div>
</div>
<a class="anchor" id="a8c41a4a0a95d25fa60012036d165abd9"></a><!-- doxytag: member="Cairo::Device::flush" ref="a8c41a4a0a95d25fa60012036d165abd9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cairo::Device::flush </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Finish any pending operations for the device and also restore any temporary modifications cairo has made to the device's state. </p>
<p>This function must be called before switching from using the device with <a class="el" href="namespaceCairo.html">Cairo</a> to operating on it directly with native APIs. If the device doesn't support direct access, then this function does nothing.</p>
<p>This function may acquire devices. </p>

</div>
</div>
<a class="anchor" id="a73a80a27c988f840701272fd571f9b5d"></a><!-- doxytag: member="Cairo::Device::get_type" ref="a73a80a27c988f840701272fd571f9b5d" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceCairo.html#acd6c59cfdf7e4c9df93011f5dcf9b55c">DeviceType</a> Cairo::Device::get_type </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This function returns the type of the device. </p>

</div>
</div>
<a class="anchor" id="a5f5bce224e01fa9fc98306361ae4e14f"></a><!-- doxytag: member="Cairo::Device::reference" ref="a5f5bce224e01fa9fc98306361ae4e14f" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cairo::Device::reference </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a044504de9e04b01d52a65521f48c0556"></a><!-- doxytag: member="Cairo::Device::release" ref="a044504de9e04b01d52a65521f48c0556" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cairo::Device::release </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Releases a device previously acquired using <a class="el" href="classCairo_1_1Device.html#aedd60074545b2d744fda80fde40bfb79" title="Acquires the device for the current thread.">acquire()</a>. </p>

</div>
</div>
<a class="anchor" id="a633b0e213b716ff4427f00025f53477f"></a><!-- doxytag: member="Cairo::Device::unreference" ref="a633b0e213b716ff4427f00025f53477f" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cairo::Device::unreference </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a2252dec9ccb0905a5b74491d4b09315d"></a><!-- doxytag: member="Cairo::Device::m_cobject" ref="a2252dec9ccb0905a5b74491d4b09315d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classCairo_1_1Device.html#a327c8a8ac39f484f68a550ae34f82411">cobject</a>* <a class="el" href="classCairo_1_1Device.html#a2252dec9ccb0905a5b74491d4b09315d">Cairo::Device::m_cobject</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>cairomm/device.h</li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon May 9 2011 09:51:07 for cairomm by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>