aboutsummaryrefslogtreecommitdiff
path: root/libX11/specs/libX11/CH05.xml
blob: c37eaddb87f6005c25b2cca40977a9523544d75f (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
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<chapter id='Pixmap_and_Cursor_Functions'>
<title>Pixmap and Cursor Functions</title>
<sect1 id="Creating_and_Freeing_Pixmaps">
<title>Creating and Freeing Pixmaps</title>
<!-- .XS -->
<!-- (SN Creating and Freeing Pixmaps -->
<!-- .XE -->
<para>
<!-- .LP -->
Pixmaps can only be used on the screen on which they were created.
Pixmaps are off-screen resources that are used for various operations,
such as defining cursors as tiling patterns 
or as the source for certain raster operations.
Most graphics requests can operate either on a window or on a pixmap.
A bitmap is a single bit-plane pixmap.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To create a pixmap of a given size, use
<xref linkend='XCreatePixmap' xrefstyle='select: title'/>.
</para>
<indexterm significance="preferred"><primary>XCreatePixmap</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XCreatePixmap'>
<funcprototype>
  <funcdef>Pixmap <function>XCreatePixmap</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>Drawable<parameter> d</parameter></paramdef>
  <paramdef>unsignedintwidth,<parameter> height</parameter></paramdef>
  <paramdef>unsignedint<parameter> depth</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>d</emphasis>
    </term>
    <listitem>
      <para>
Specifies which screen the pixmap is created on. 
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>width</emphasis>
    </term>
    <listitem>
      <para>
<!-- .br -->
<!-- .ns -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>height</emphasis>
    </term>
    <listitem>
      <para>
Specify the width and height, which define the dimensions of the pixmap.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>depth</emphasis>
    </term>
    <listitem>
      <para>
Specifies the depth of the pixmap.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM  -->
The
<xref linkend='XCreatePixmap' xrefstyle='select: title'/>
function creates a pixmap of the width, height, and depth you specified
and returns a pixmap ID that identifies it.
It is valid to pass an 
<symbol>InputOnly</symbol>
window to the drawable argument.
The width and height arguments must be nonzero,
or a 
<errorname>BadValue</errorname>
error results.
The depth argument must be one of the depths supported by the screen
of the specified drawable,
or a
<errorname>BadValue</errorname>
error results.
</para>
<para>
<!-- .LP -->
The server uses the specified drawable to determine on which screen
to create the pixmap.
The pixmap can be used only on this screen
and only with other drawables of the same depth (see
<xref linkend='XCopyPlane' xrefstyle='select: title'/>
for an exception to this rule).
The initial contents of the pixmap are undefined.
</para>
<para>
<!-- .LP -->
<xref linkend='XCreatePixmap' xrefstyle='select: title'/>
can generate
<errorname>BadAlloc</errorname>,
<errorname>BadDrawable</errorname>,
and
<errorname>BadValue</errorname>
errors.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To free all storage associated with a specified pixmap, use
<xref linkend='XFreePixmap' xrefstyle='select: title'/>.
</para>
<indexterm significance="preferred"><primary>XFreePixmap</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XFreePixmap'>
<funcprototype>
  <funcdef><function>XFreePixmap</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>Pixmap<parameter> pixmap</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN	 -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>pixmap</emphasis>
    </term>
    <listitem>
      <para>
Specifies the pixmap.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM  -->
The
<xref linkend='XFreePixmap' xrefstyle='select: title'/>
function first deletes the association between the pixmap ID and the pixmap.
Then, the X server frees the pixmap storage when there are no references to it.
The pixmap should never be referenced again.
</para>
<para>
<!-- .LP -->
<xref linkend='XFreePixmap' xrefstyle='select: title'/>
can generate a
<errorname>BadPixmap</errorname>
error.
</para>
</sect1>
<sect1 id="Creating_Recoloring_and_Freeing_Cursors">
<title>Creating, Recoloring, and Freeing Cursors</title>
<!-- .XS -->
<!-- (SN Creating, Recoloring, and Freeing Cursors  -->
<!-- .XE -->
<para>
<!-- .LP -->
Each window can have a different cursor defined for it.
Whenever the pointer is in a visible window, 
it is set to the cursor defined for that window.
If no cursor was defined for that window, 
the cursor is the one defined for the parent window.
</para>
<para>
<!-- .LP -->
From X's perspective, 
a cursor consists of a cursor source, mask, colors, and a hotspot. 
The mask pixmap determines the shape of the cursor and must be a depth
of one.
The source pixmap must have a depth of one,
and the colors determine the colors of the source.
The hotspot defines the point on the cursor that is reported
when a pointer event occurs.
There may be limitations imposed by the hardware on
cursors as to size and whether a mask is implemented. 
<indexterm><primary>XQueryBestCursor</primary></indexterm>
<xref linkend='XQueryBestCursor' xrefstyle='select: title'/>
can be used to find out what sizes are possible.
There is a standard font for creating cursors, but
Xlib provides functions that you can use to create cursors
from an arbitrary font or from bitmaps.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To create a cursor from the standard cursor font, use
<xref linkend='XCreateFontCursor' xrefstyle='select: title'/>.
</para>
<para>
#include &lt;X11/cursorfont.h&gt;
</para>

<indexterm significance="preferred"><primary>XCreateFontCursor</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XCreateFontCursor'>
<funcprototype>
  <funcdef>Cursor <function>XCreateFontCursor</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>unsignedint<parameter> shape</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>shape</emphasis>
    </term>
    <listitem>
      <para>
Specifies the shape of the cursor.
    </para>
  </listitem>
  </varlistentry>
</variablelist>

<para>
<!-- .LP -->
<!-- .eM -->
X provides a set of standard cursor shapes in a special font named
cursor.
Applications are encouraged to use this interface for their cursors
because the font can be customized for the individual display type.
The shape argument specifies which glyph of the standard fonts
to use.
</para>
<para>
<!-- .LP -->
The hotspot comes from the information stored in the cursor font.
The initial colors of a cursor are a black foreground and a white
background (see
<xref linkend='XRecolorCursor' xrefstyle='select: title'/>).
For further information about cursor shapes,
see <link linkend="x_font_cursors">appendix B</link>.
</para>
<para>
<!-- .LP -->
<xref linkend='XCreateFontCursor' xrefstyle='select: title'/>
can generate
<errorname>BadAlloc</errorname>
and
<errorname>BadValue</errorname>
errors.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To create a cursor from font glyphs, use
<xref linkend='XCreateGlyphCursor' xrefstyle='select: title'/>.
</para>
<indexterm significance="preferred"><primary>XCreateGlyphCursor</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XCreateGlyphCursor'>
<funcprototype>
  <funcdef>Cursor <function>XCreateGlyphCursor</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>Fontsource_font,<parameter> mask_font</parameter></paramdef>
  <paramdef>unsignedintsource_char,<parameter> mask_char</parameter></paramdef>
  <paramdef>XColor<parameter> *foreground_color</parameter></paramdef>
  <paramdef>XColor<parameter> *background_color</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>source_font</emphasis>
    </term>
    <listitem>
      <para>
Specifies the font for the source glyph.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>mask_font</emphasis>
    </term>
    <listitem>
      <para>
Specifies the font for the mask glyph or
<symbol>None</symbol>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>source_char</emphasis>
    </term>
    <listitem>
      <para>
Specifies the character glyph for the source.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>mask_char</emphasis>
    </term>
    <listitem>
      <para>
Specifies the glyph character for the mask. 
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>foreground_color</emphasis>
    </term>
    <listitem>
      <para>
Specifies the <acronym>RGB</acronym> values for the foreground of the source. 
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>background_color</emphasis>
    </term>
    <listitem>
      <para>
Specifies the <acronym>RGB</acronym> values for the background of the source.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<xref linkend='XCreateGlyphCursor' xrefstyle='select: title'/>
function is similar to
<xref linkend='XCreatePixmapCursor' xrefstyle='select: title'/>
except that the source and mask bitmaps are obtained from the specified 
font glyphs.
The source_char must be a defined glyph in source_font, 
or a
<errorname>BadValue</errorname>
error results.
If mask_font is given, 
mask_char must be a defined glyph in mask_font,
or a
<errorname>BadValue</errorname>
error results.
The mask_font and character are optional.
The origins of the source_char and mask_char (if defined) glyphs are
positioned coincidently and define the hotspot. 
The source_char and mask_char need not have the same bounding box metrics, 
and there is no restriction on the placement of the hotspot relative to the bounding
boxes. 
If no mask_char is given, all pixels of the source are displayed.
You can free the fonts immediately by calling
<xref linkend='XFreeFont' xrefstyle='select: title'/>
if no further explicit references to them are to be made. 
</para>
<para>
<!-- .LP -->
For 2-byte matrix fonts, 
the 16-bit value should be formed with the byte1
member in the most significant byte and the byte2 member in the 
least significant byte.
</para>
<para>
<!-- .LP -->
<xref linkend='XCreateGlyphCursor' xrefstyle='select: title'/>
can generate
<errorname>BadAlloc</errorname>,
<errorname>BadFont</errorname>,
and
<errorname>BadValue</errorname>
errors.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To create a cursor from two bitmaps,
use
<xref linkend='XCreatePixmapCursor' xrefstyle='select: title'/>.
</para>
<indexterm significance="preferred"><primary>XCreatePixmapCursor</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XCreatePixmapCursor'>
<funcprototype>
  <funcdef>Cursor <function>XCreatePixmapCursor</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>Pixmap<parameter> source</parameter></paramdef>
  <paramdef>Pixmap<parameter> mask</parameter></paramdef>
  <paramdef>XColor<parameter> *foreground_color</parameter></paramdef>
  <paramdef>XColor<parameter> *background_color</parameter></paramdef>
  <paramdef>unsignedintx,<parameter> y</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>source</emphasis>
    </term>
    <listitem>
      <para>
Specifies the shape of the source cursor.
<!-- .\" *** JIM: NEED TO CHECK THIS. *** -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>mask</emphasis>
    </term>
    <listitem>
      <para>
Specifies the cursor's source bits to be displayed or
<symbol>None</symbol>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>foreground_color</emphasis>
    </term>
    <listitem>
      <para>
Specifies the <acronym>RGB</acronym> values for the foreground of the source. 
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>background_color</emphasis>
    </term>
    <listitem>
      <para>
Specifies the <acronym>RGB</acronym> values for the background of the source.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>x</emphasis>
    </term>
    <listitem>
      <para>
<!-- .br -->
<!-- .ns -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>y</emphasis>
    </term>
    <listitem>
      <para>
Specify the x and y coordinates, which indicate the hotspot relative to the
source's origin.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<xref linkend='XCreatePixmapCursor' xrefstyle='select: title'/>
function creates a cursor and returns the cursor ID associated with it.
The foreground and background <acronym>RGB</acronym> values must be specified using
foreground_color and background_color,
even if the X server only has a
<symbol>StaticGray</symbol>
or
<symbol>GrayScale</symbol>
screen.
The foreground color is used for the pixels set to 1 in the
source, and the background color is used for the pixels set to 0.
Both source and mask, if specified, must have depth one (or a 
<errorname>BadMatch</errorname>
error results) but can have any root.
The mask argument defines the shape of the cursor.
The pixels set to 1 in the mask define which source pixels are displayed,
and the pixels set to 0 define which pixels are ignored.
If no mask is given, 
all pixels of the source are displayed.
The mask, if present, must be the same size as the pixmap defined by the 
source argument, or a
<errorname>BadMatch</errorname>
error results.
The hotspot must be a point within the source,
or a
<errorname>BadMatch</errorname>
error results.
</para>
<para>
<!-- .LP -->
The components of the cursor can be transformed arbitrarily to meet
display limitations.
The pixmaps can be freed immediately if no further explicit references
to them are to be made.
Subsequent drawing in the source or mask pixmap has an undefined effect on the
cursor.
The X server might or might not make a copy of the pixmap.
</para>
<para>
<!-- .LP -->
<xref linkend='XCreatePixmapCursor' xrefstyle='select: title'/>
can generate
<errorname>BadAlloc</errorname>
and
<errorname>BadPixmap</errorname>
errors.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To determine useful cursor sizes, use
<xref linkend='XQueryBestCursor' xrefstyle='select: title'/>.
</para>
<indexterm significance="preferred"><primary>XQueryBestCursor</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XQueryBestCursor'>
<funcprototype>
  <funcdef>Status <function>XQueryBestCursor</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>Drawable<parameter> d</parameter></paramdef>
  <paramdef>unsignedintwidth,<parameter> height</parameter></paramdef>
  <paramdef>unsignedint*width_return,<parameter> *height_return</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>d</emphasis>
    </term>
    <listitem>
      <para>
Specifies the drawable, which indicates the screen.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>width</emphasis>
    </term>
    <listitem>
      <para>
<!-- .br -->
<!-- .ns -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>height</emphasis>
    </term>
    <listitem>
      <para>
Specify the width and height of the cursor that you want the size
information for.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>width_return</emphasis>
    </term>
    <listitem>
      <para>
<!-- .br -->
<!-- .ns -->
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>height_return</emphasis>
    </term>
    <listitem>
      <para>
Return the best width and height that is closest to the specified width 
and height.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
Some displays allow larger cursors than other displays.
The
<xref linkend='XQueryBestCursor' xrefstyle='select: title'/>
function provides a way to find out what size cursors are actually
possible on the display.
<indexterm ><primary>Cursor</primary><secondary>limitations</secondary></indexterm>
It returns the largest size that can be displayed.
Applications should be prepared to use smaller cursors on displays that
cannot support large ones.
</para>
<para>
<!-- .LP -->
<xref linkend='XQueryBestCursor' xrefstyle='select: title'/>
can generate a
<errorname>BadDrawable</errorname>
error.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To change the color of a given cursor, use
<xref linkend='XRecolorCursor' xrefstyle='select: title'/>.
</para>
<indexterm significance="preferred"><primary>XRecolorCursor</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XRecolorCursor'>
<funcprototype>
  <funcdef><function>XRecolorCursor</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>Cursor<parameter> cursor</parameter></paramdef>
  <paramdef>XColor*foreground_color,<parameter> *background_color</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>cursor</emphasis>
    </term>
    <listitem>
      <para>
Specifies the cursor. 
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>foreground_color</emphasis>
    </term>
    <listitem>
      <para>
Specifies the <acronym>RGB</acronym> values for the foreground of the source. 
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>background_color</emphasis>
    </term>
    <listitem>
      <para>
Specifies the <acronym>RGB</acronym> values for the background of the source.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<xref linkend='XRecolorCursor' xrefstyle='select: title'/>
function changes the color of the specified cursor, and
if the cursor is being displayed on a screen,
the change is visible immediately.
The pixel members of the
<structname>XColor</structname>
structures are ignored; only the <acronym>RGB</acronym> values are used.
</para>
<para>
<!-- .LP -->
<xref linkend='XRecolorCursor' xrefstyle='select: title'/>
can generate a
<errorname>BadCursor</errorname>
error.
</para>
<para>
<!-- .LP -->
<!-- .sp -->
To free (destroy) a given cursor, use
<xref linkend='XFreeCursor' xrefstyle='select: title'/>.
</para>
<indexterm significance="preferred"><primary>XFreeCursor</primary></indexterm>
<!-- .sM -->
<funcsynopsis id='XFreeCursor'>
<funcprototype>
  <funcdef><function>XFreeCursor</function></funcdef>
  <paramdef>Display<parameter> *display</parameter></paramdef>
  <paramdef>Cursor<parameter> cursor</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the connection to the X server.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>cursor</emphasis>
    </term>
    <listitem>
      <para>
Specifies the cursor. 
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM  -->
The
<xref linkend='XFreeCursor' xrefstyle='select: title'/>
function deletes the association between the cursor resource ID 
and the specified cursor.
The cursor storage is freed when no other resource references it.
The specified cursor ID should not be referred to again.
</para>
<para>
<!-- .LP -->
<xref linkend='XFreeCursor' xrefstyle='select: title'/>
can generate a
<errorname>BadCursor</errorname>
error.
<!-- .bp -->

</para>
</sect1>
</chapter>