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
|
<?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-XLib-Surfaces">
<refmeta>
<refentrytitle id="top_of_page">XLib Surfaces</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>XLib Surfaces</refname>
<refpurpose>X Window System rendering using XLib</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv id="synopsis">
<title id="synopsis.title">Synopsis</title>
<synopsis>
<link linkend="cairo-surface-t">cairo_surface_t</link>* <link linkend="cairo-xlib-surface-create">cairo_xlib_surface_create</link> (<link linkend="Display">Display</link> *dpy,
<link linkend="Drawable">Drawable</link> drawable,
<link linkend="Visual">Visual</link> *visual,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);
<link linkend="cairo-surface-t">cairo_surface_t</link>* <link linkend="cairo-xlib-surface-create-for-bitmap">cairo_xlib_surface_create_for_bitmap</link>
(<link linkend="Display">Display</link> *dpy,
<link linkend="Pixmap">Pixmap</link> bitmap,
<link linkend="Screen">Screen</link> *screen,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);
<link linkend="void">void</link> <link linkend="cairo-xlib-surface-set-size">cairo_xlib_surface_set_size</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);
<link linkend="Display">Display</link>* <link linkend="cairo-xlib-surface-get-display">cairo_xlib_surface_get_display</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
<link linkend="Screen">Screen</link>* <link linkend="cairo-xlib-surface-get-screen">cairo_xlib_surface_get_screen</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
<link linkend="void">void</link> <link linkend="cairo-xlib-surface-set-drawable">cairo_xlib_surface_set_drawable</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface,
<link linkend="Drawable">Drawable</link> drawable,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);
<link linkend="Drawable">Drawable</link> <link linkend="cairo-xlib-surface-get-drawable">cairo_xlib_surface_get_drawable</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
<link linkend="Visual">Visual</link>* <link linkend="cairo-xlib-surface-get-visual">cairo_xlib_surface_get_visual</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
<link linkend="int">int</link> <link linkend="cairo-xlib-surface-get-width">cairo_xlib_surface_get_width</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
<link linkend="int">int</link> <link linkend="cairo-xlib-surface-get-height">cairo_xlib_surface_get_height</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
<link linkend="int">int</link> <link linkend="cairo-xlib-surface-get-depth">cairo_xlib_surface_get_depth</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
</synopsis>
</refsynopsisdiv>
<refsect1 id="desc">
<title id="desc.title">Description</title>
<para>
</para>
</refsect1>
<refsect1 id="details">
<title id="details.title">Details</title>
<refsect2>
<title><anchor id="cairo-xlib-surface-create" role="function"/>cairo_xlib_surface_create ()</title>
<indexterm><primary>cairo_xlib_surface_create</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link>* cairo_xlib_surface_create (<link linkend="Display">Display</link> *dpy,
<link linkend="Drawable">Drawable</link> drawable,
<link linkend="Visual">Visual</link> *visual,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);</programlisting>
<para>
Creates an Xlib surface that draws to the given drawable.
The way that colors are represented in the drawable is specified
by the provided visual.
</para>
<para>
NOTE: If <parameter>drawable</parameter> is a Window, then the function
cairo_xlib_surface_set_size must be called whenever the size of the
window changes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>dpy</parameter> :</term>
<listitem><simpara> an X Display
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable</parameter> :</term>
<listitem><simpara> an X Drawable, (a Pixmap or a Window)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>visual</parameter> :</term>
<listitem><simpara> the visual to use for drawing to <parameter>drawable</parameter>. The depth
of the visual must match the depth of the drawable.
Currently, only TrueColor visuals are fully supported.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter> :</term>
<listitem><simpara> the current width of <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter> :</term>
<listitem><simpara> the current height of <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly created surface
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-create-for-bitmap" role="function"/>cairo_xlib_surface_create_for_bitmap ()</title>
<indexterm><primary>cairo_xlib_surface_create_for_bitmap</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link>* cairo_xlib_surface_create_for_bitmap
(<link linkend="Display">Display</link> *dpy,
<link linkend="Pixmap">Pixmap</link> bitmap,
<link linkend="Screen">Screen</link> *screen,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);</programlisting>
<para>
Creates an Xlib surface that draws to the given bitmap.
This will be drawn to as a CAIRO_FORMAT_A1 object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>dpy</parameter> :</term>
<listitem><simpara> an X Display
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>bitmap</parameter> :</term>
<listitem><simpara> an X Drawable, (a depth-1 Pixmap)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>screen</parameter> :</term>
<listitem><simpara> the X Screen associated with <parameter>bitmap</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter> :</term>
<listitem><simpara> the current width of <parameter>bitmap</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter> :</term>
<listitem><simpara> the current height of <parameter>bitmap</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly created surface
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-set-size" role="function"/>cairo_xlib_surface_set_size ()</title>
<indexterm><primary>cairo_xlib_surface_set_size</primary></indexterm><programlisting><link linkend="void">void</link> cairo_xlib_surface_set_size (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);</programlisting>
<para>
Informs cairo of the new size of the X Drawable underlying the
surface. For a surface created for a Window (rather than a Pixmap),
this function must be called each time the size of the window
changes. (For a subwindow, you are normally resizing the window
yourself, but for a toplevel window, it is necessary to listen for
ConfigureNotify events.)
</para>
<para>
A Pixmap can never change size, so it is never necessary to call
this function on a surface created for a Pixmap.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> for the XLib backend
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter> :</term>
<listitem><simpara> the new width of the surface
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter> :</term>
<listitem><simpara> the new height of the surface
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-display" role="function" condition="since:1.2"/>cairo_xlib_surface_get_display ()</title>
<indexterm role="1.2"><primary>cairo_xlib_surface_get_display</primary></indexterm><programlisting><link linkend="Display">Display</link>* cairo_xlib_surface_get_display (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Get the X Display for the underlying X Drawable.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-xlib-surface-t"><type>cairo_xlib_surface_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the display.
</simpara></listitem></varlistentry>
</variablelist><para>Since 1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-screen" role="function" condition="since:1.2"/>cairo_xlib_surface_get_screen ()</title>
<indexterm role="1.2"><primary>cairo_xlib_surface_get_screen</primary></indexterm><programlisting><link linkend="Screen">Screen</link>* cairo_xlib_surface_get_screen (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Get the X Screen for the underlying X Drawable.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-xlib-surface-t"><type>cairo_xlib_surface_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the screen.
</simpara></listitem></varlistentry>
</variablelist><para>Since 1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-set-drawable" role="function"/>cairo_xlib_surface_set_drawable ()</title>
<indexterm><primary>cairo_xlib_surface_set_drawable</primary></indexterm><programlisting><link linkend="void">void</link> cairo_xlib_surface_set_drawable (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface,
<link linkend="Drawable">Drawable</link> drawable,
<link linkend="int">int</link> width,
<link linkend="int">int</link> height);</programlisting>
<para>
Informs cairo of a new X Drawable underlying the
surface. The drawable must match the display, screen
and format of the existing drawable or the application
will get X protocol errors and will probably terminate.
No checks are done by this function to ensure this
compatibility.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> for the XLib backend
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable</parameter> :</term>
<listitem><simpara> the new drawable for the surface
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter> :</term>
<listitem><simpara> the width of the new drawable
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter> :</term>
<listitem><simpara> the height of the new drawable
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-drawable" role="function" condition="since:1.2"/>cairo_xlib_surface_get_drawable ()</title>
<indexterm role="1.2"><primary>cairo_xlib_surface_get_drawable</primary></indexterm><programlisting><link linkend="Drawable">Drawable</link> cairo_xlib_surface_get_drawable (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Get the underlying X Drawable used for the surface.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-xlib-surface-t"><type>cairo_xlib_surface_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the drawable.
</simpara></listitem></varlistentry>
</variablelist><para>Since 1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-visual" role="function" condition="since:1.2"/>cairo_xlib_surface_get_visual ()</title>
<indexterm role="1.2"><primary>cairo_xlib_surface_get_visual</primary></indexterm><programlisting><link linkend="Visual">Visual</link>* cairo_xlib_surface_get_visual (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Get the X Visual used for underlying X Drawable.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-xlib-surface-t"><type>cairo_xlib_surface_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the visual.
</simpara></listitem></varlistentry>
</variablelist><para>Since 1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-width" role="function" condition="since:1.2"/>cairo_xlib_surface_get_width ()</title>
<indexterm role="1.2"><primary>cairo_xlib_surface_get_width</primary></indexterm><programlisting><link linkend="int">int</link> cairo_xlib_surface_get_width (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Get the width of the X Drawable underlying the surface in pixels.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-xlib-surface-t"><type>cairo_xlib_surface_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the width of the surface in pixels.
</simpara></listitem></varlistentry>
</variablelist><para>Since 1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-height" role="function" condition="since:1.2"/>cairo_xlib_surface_get_height ()</title>
<indexterm role="1.2"><primary>cairo_xlib_surface_get_height</primary></indexterm><programlisting><link linkend="int">int</link> cairo_xlib_surface_get_height (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Get the height of the X Drawable underlying the surface in pixels.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-xlib-surface-t"><type>cairo_xlib_surface_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the height of the surface in pixels.
</simpara></listitem></varlistentry>
</variablelist><para>Since 1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-depth" role="function" condition="since:1.2"/>cairo_xlib_surface_get_depth ()</title>
<indexterm role="1.2"><primary>cairo_xlib_surface_get_depth</primary></indexterm><programlisting><link linkend="int">int</link> cairo_xlib_surface_get_depth (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Get the number of bits used to represent each pixel value.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter> :</term>
<listitem><simpara> a <link linkend="cairo-xlib-surface-t"><type>cairo_xlib_surface_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the depth of the surface in bits.
</simpara></listitem></varlistentry>
</variablelist><para>Since 1.2
</para></refsect2>
</refsect1>
</refentry>
|