summaryrefslogtreecommitdiff
path: root/libs/cairo-1.16.0/doc/public/xml/cairo-win32.xml
blob: 52b7a71dd5c0ab0a18be1287ff24f60a151a1a6f (plain)
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
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
		"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cairo-Win32-Surfaces">
<refmeta>
<refentrytitle role="top_of_page" id="cairo-Win32-Surfaces.top_of_page">Win32 Surfaces</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Win32 Surfaces</refname>
<refpurpose>Microsoft Windows surface support</refpurpose>
</refnamediv>

<refsect1 id="cairo-Win32-Surfaces.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-win32-surface-create">cairo_win32_surface_create</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-win32-surface-create-with-dib">cairo_win32_surface_create_with_dib</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-win32-surface-create-with-ddb">cairo_win32_surface_create_with_ddb</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-win32-surface-create-with-format">cairo_win32_surface_create_with_format</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-win32-printing-surface-create">cairo_win32_printing_surface_create</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="HDC:CAPS"><returnvalue>HDC</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-win32-surface-get-dc">cairo_win32_surface_get_dc</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-win32-surface-get-image">cairo_win32_surface_get_image</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="cairo-Win32-Surfaces.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="name" colwidth="150px"/>
<colspec colname="description"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="CAIRO-HAS-WIN32-SURFACE:CAPS">CAIRO_HAS_WIN32_SURFACE</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>


<refsect1 id="cairo-Win32-Surfaces.description" role="desc">
<title role="desc.title">Description</title>
<para>The Microsoft Windows surface is used to render cairo graphics to
Microsoft Windows windows, bitmaps, and printing device contexts.</para>
<para>The surface returned by <link linkend="cairo-win32-printing-surface-create"><function>cairo_win32_printing_surface_create()</function></link> is of surface
type <link linkend="CAIRO-SURFACE-TYPE-WIN32-PRINTING:CAPS"><literal>CAIRO_SURFACE_TYPE_WIN32_PRINTING</literal></link> and is a multi-page vector surface
type.</para>
<para>The surface returned by the other win32 constructors is of surface type
<link linkend="CAIRO-SURFACE-TYPE-WIN32:CAPS"><literal>CAIRO_SURFACE_TYPE_WIN32</literal></link> and is a raster surface type.</para>

</refsect1>
<refsect1 id="cairo-Win32-Surfaces.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="cairo-win32-surface-create" role="function" condition="since:1.0">
<title>cairo_win32_surface_create&#160;()</title>
<indexterm zone="cairo-win32-surface-create" role="1.0"><primary sortas="win32_surface_create">cairo_win32_surface_create</primary></indexterm>
<programlisting language="C"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
cairo_win32_surface_create (<parameter><link linkend="HDC:CAPS"><type>HDC</type></link> hdc</parameter>);</programlisting>
<para>Creates a cairo surface that targets the given DC.  The DC will be
queried for its initial clip extents, and this will be used as the
size of the cairo surface.  The resulting surface will always be of
format <link linkend="CAIRO-FORMAT-RGB24:CAPS"><literal>CAIRO_FORMAT_RGB24</literal></link>; should you need another surface format,
you will need to create one through
<link linkend="cairo-win32-surface-create-with-format"><function>cairo_win32_surface_create_with_format()</function></link> or
<link linkend="cairo-win32-surface-create-with-dib"><function>cairo_win32_surface_create_with_dib()</function></link>.</para>
<refsect3 id="cairo-win32-surface-create.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hdc</para></entry>
<entry role="parameter_description"><para>the DC to create a surface for</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-win32-surface-create.returns" role="returns">
<title>Returns</title>
<para> the newly created surface, NULL on failure</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-win32-surface-create-with-dib" role="function" condition="since:1.2">
<title>cairo_win32_surface_create_with_dib&#160;()</title>
<indexterm zone="cairo-win32-surface-create-with-dib" role="1.2"><primary sortas="win32_surface_create_with_dib">cairo_win32_surface_create_with_dib</primary></indexterm>
<programlisting language="C"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
cairo_win32_surface_create_with_dib (<parameter><link linkend="cairo-format-t"><type>cairo_format_t</type></link> format</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> width</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> height</parameter>);</programlisting>
<para>Creates a device-independent-bitmap surface not associated with
any particular existing surface or device context. The created
bitmap will be uninitialized.</para>
<refsect3 id="cairo-win32-surface-create-with-dib.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>format</para></entry>
<entry role="parameter_description"><para>format of pixels in the surface to create</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>width of the surface, in pixels</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>height of the surface, in pixels</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-win32-surface-create-with-dib.returns" role="returns">
<title>Returns</title>
<para> the newly created surface</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-win32-surface-create-with-ddb" role="function" condition="since:1.4">
<title>cairo_win32_surface_create_with_ddb&#160;()</title>
<indexterm zone="cairo-win32-surface-create-with-ddb" role="1.4"><primary sortas="win32_surface_create_with_ddb">cairo_win32_surface_create_with_ddb</primary></indexterm>
<programlisting language="C"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
cairo_win32_surface_create_with_ddb (<parameter><link linkend="HDC:CAPS"><type>HDC</type></link> hdc</parameter>,
                                     <parameter><link linkend="cairo-format-t"><type>cairo_format_t</type></link> format</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> width</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> height</parameter>);</programlisting>
<para>Creates a device-dependent-bitmap surface not associated with
any particular existing surface or device context. The created
bitmap will be uninitialized.</para>
<refsect3 id="cairo-win32-surface-create-with-ddb.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hdc</para></entry>
<entry role="parameter_description"><para>a DC compatible with the surface to create</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>format</para></entry>
<entry role="parameter_description"><para>format of pixels in the surface to create</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>width of the surface, in pixels</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>height of the surface, in pixels</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-win32-surface-create-with-ddb.returns" role="returns">
<title>Returns</title>
<para> the newly created surface</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2>
<refsect2 id="cairo-win32-surface-create-with-format" role="function" condition="since:1.14">
<title>cairo_win32_surface_create_with_format&#160;()</title>
<indexterm zone="cairo-win32-surface-create-with-format" role="1.14"><primary sortas="win32_surface_create_with_format">cairo_win32_surface_create_with_format</primary></indexterm>
<programlisting language="C"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
cairo_win32_surface_create_with_format
                               (<parameter><link linkend="HDC:CAPS"><type>HDC</type></link> hdc</parameter>,
                                <parameter><link linkend="cairo-format-t"><type>cairo_format_t</type></link> format</parameter>);</programlisting>
<para>Creates a cairo surface that targets the given DC.  The DC will be
queried for its initial clip extents, and this will be used as the
size of the cairo surface.</para>
<para>Supported formats are:
<link linkend="CAIRO-FORMAT-ARGB32:CAPS"><literal>CAIRO_FORMAT_ARGB32</literal></link>
<link linkend="CAIRO-FORMAT-RGB24:CAPS"><literal>CAIRO_FORMAT_RGB24</literal></link></para>
<para>Note: <parameter>format</parameter>
 only tells cairo how to draw on the surface, not what
the format of the surface is. Namely, cairo does not (and cannot)
check that <parameter>hdc</parameter>
 actually supports alpha-transparency.</para>
<refsect3 id="cairo-win32-surface-create-with-format.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hdc</para></entry>
<entry role="parameter_description"><para>the DC to create a surface for</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>format</para></entry>
<entry role="parameter_description"><para>format of pixels in the surface to create</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-win32-surface-create-with-format.returns" role="returns">
<title>Returns</title>
<para> the newly created surface, NULL on failure</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.14">1.14</link></para></refsect2>
<refsect2 id="cairo-win32-printing-surface-create" role="function" condition="since:1.6">
<title>cairo_win32_printing_surface_create&#160;()</title>
<indexterm zone="cairo-win32-printing-surface-create" role="1.6"><primary sortas="win32_printing_surface_create">cairo_win32_printing_surface_create</primary></indexterm>
<programlisting language="C"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
cairo_win32_printing_surface_create (<parameter><link linkend="HDC:CAPS"><type>HDC</type></link> hdc</parameter>);</programlisting>
<para>Creates a cairo surface that targets the given DC.  The DC will be
queried for its initial clip extents, and this will be used as the
size of the cairo surface.  The DC should be a printing DC;
antialiasing will be ignored, and GDI will be used as much as
possible to draw to the surface.</para>
<para>The returned surface will be wrapped using the paginated surface to
provide correct complex rendering behaviour; <link linkend="cairo-surface-show-page"><function>cairo_surface_show_page()</function></link> and
associated methods must be used for correct output.</para>
<refsect3 id="cairo-win32-printing-surface-create.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hdc</para></entry>
<entry role="parameter_description"><para>the DC to create a surface for</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-win32-printing-surface-create.returns" role="returns">
<title>Returns</title>
<para> the newly created surface</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.6">1.6</link></para></refsect2>
<refsect2 id="cairo-win32-surface-get-dc" role="function" condition="since:1.2">
<title>cairo_win32_surface_get_dc&#160;()</title>
<indexterm zone="cairo-win32-surface-get-dc" role="1.2"><primary sortas="win32_surface_get_dc">cairo_win32_surface_get_dc</primary></indexterm>
<programlisting language="C"><link linkend="HDC:CAPS"><returnvalue>HDC</returnvalue></link>
cairo_win32_surface_get_dc (<parameter><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> *surface</parameter>);</programlisting>
<para>Returns the HDC associated with this surface, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none.
Also returns <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the surface is not a win32 surface.</para>
<para>A call to <link linkend="cairo-surface-flush"><function>cairo_surface_flush()</function></link> is required before using the HDC to
ensure that all pending drawing operations are finished and to
restore any temporary modification cairo has made to its state. A
call to <link linkend="cairo-surface-mark-dirty"><function>cairo_surface_mark_dirty()</function></link> is required after the state or
the content of the HDC has been modified.</para>
<refsect3 id="cairo-win32-surface-get-dc.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>surface</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-win32-surface-get-dc.returns" role="returns">
<title>Returns</title>
<para> HDC or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no HDC available.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-win32-surface-get-image" role="function" condition="since:1.4">
<title>cairo_win32_surface_get_image&#160;()</title>
<indexterm zone="cairo-win32-surface-get-image" role="1.4"><primary sortas="win32_surface_get_image">cairo_win32_surface_get_image</primary></indexterm>
<programlisting language="C"><link linkend="cairo-surface-t"><returnvalue>cairo_surface_t</returnvalue></link>&#160;*
cairo_win32_surface_get_image (<parameter><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> *surface</parameter>);</programlisting>
<para>Returns a <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> image surface that refers to the same bits
as the DIB of the Win32 surface.  If the passed-in win32 surface
is not a DIB surface, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.</para>
<refsect3 id="cairo-win32-surface-get-image.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>surface</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-win32-surface-get-image.returns" role="returns">
<title>Returns</title>
<para> a <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> (owned by the win32 <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link>),
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the win32 surface is not a DIB.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2>

</refsect1>
<refsect1 id="cairo-Win32-Surfaces.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="CAIRO-HAS-WIN32-SURFACE:CAPS" role="macro" condition="since:1.0">
<title>CAIRO_HAS_WIN32_SURFACE</title>
<indexterm zone="CAIRO-HAS-WIN32-SURFACE:CAPS" role="1.0"><primary sortas="HAS_WIN32_SURFACE">CAIRO_HAS_WIN32_SURFACE</primary></indexterm>
<programlisting language="C">#define CAIRO_HAS_WIN32_SURFACE 1
</programlisting>
<para>Defined if the Microsoft Windows surface backend is available.
This macro can be used to conditionally compile backend-specific code.</para>
<para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>

</refsect1>
<refsect1 id="cairo-Win32-Surfaces.see-also">
<title>See Also</title>
<para><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link></para>

</refsect1>

</refentry>