2003-11-14 16:48:48 +00:00
|
|
|
.\"
|
2004-12-04 00:42:47 +00:00
|
|
|
.\" Copyright © 2002 Keith Packard
|
2003-11-14 16:48:48 +00:00
|
|
|
.\"
|
|
|
|
|
.\" Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
|
.\" documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
|
.\" the above copyright notice appear in all copies and that both that
|
|
|
|
|
.\" copyright notice and this permission notice appear in supporting
|
|
|
|
|
.\" documentation, and that the name of Keith Packard not be used in
|
|
|
|
|
.\" advertising or publicity pertaining to distribution of the software without
|
|
|
|
|
.\" specific, written prior permission. Keith Packard makes no
|
|
|
|
|
.\" representations about the suitability of this software for any purpose. It
|
|
|
|
|
.\" is provided "as is" without express or implied warranty.
|
|
|
|
|
.\"
|
|
|
|
|
.\" KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
|
.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
|
.\" EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
|
.\" CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
|
.\" DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
|
.\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
.\" PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
.\"
|
2021-03-14 17:18:59 -04:00
|
|
|
.de NS
|
2003-11-14 16:48:48 +00:00
|
|
|
.br
|
|
|
|
|
.ns
|
|
|
|
|
.TP \\$1
|
2021-03-14 19:24:48 -04:00
|
|
|
.na
|
|
|
|
|
.nf
|
2003-11-14 16:48:48 +00:00
|
|
|
..
|
2021-03-14 17:18:59 -04:00
|
|
|
.de NE
|
|
|
|
|
.br
|
|
|
|
|
.ad
|
2021-03-14 19:24:48 -04:00
|
|
|
.fi
|
2021-03-14 17:18:59 -04:00
|
|
|
..
|
2021-03-11 20:17:08 -05:00
|
|
|
.ie \n(.g .ds `` \(lq
|
|
|
|
|
.el .ds `` ``
|
|
|
|
|
.ie \n(.g .ds '' \(rq
|
|
|
|
|
.el .ds '' ''
|
2007-08-21 19:33:00 -07:00
|
|
|
.TH XCURSOR __libmansuffix__ __xorgversion__ "Keith Packard"
|
2021-03-14 17:18:59 -04:00
|
|
|
.hy 0
|
2003-11-14 16:48:48 +00:00
|
|
|
.SH NAME
|
|
|
|
|
XCURSOR \- Cursor management library
|
|
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
.nf
|
|
|
|
|
.B #include <X11/Xcursor/Xcursor.h>
|
|
|
|
|
.fi
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
.B Xcursor
|
2021-03-15 19:00:14 -04:00
|
|
|
is a simple library designed to help locate and load cursors.
|
|
|
|
|
Cursors can be loaded from files or memory.
|
|
|
|
|
A library of common cursors exists which
|
|
|
|
|
map to the standard X cursor names.
|
|
|
|
|
Cursors can exist in several sizes and
|
2003-11-14 16:48:48 +00:00
|
|
|
the library automatically picks the best size.
|
|
|
|
|
|
|
|
|
|
.SH FUNCTIONAL OVERVIEW
|
|
|
|
|
Xcursor is built in a couple of layers; at the bottom layer is code which
|
|
|
|
|
can load cursor images from files. Above that is a layer which locates
|
|
|
|
|
cursor files based on the library path and theme. At the top is a layer
|
|
|
|
|
which builds cursors either out of an image loaded from a file or one of the
|
|
|
|
|
standard X cursors. When using images loaded from files, Xcursor prefers
|
|
|
|
|
to use the Render extension CreateCursor request if supported by the X
|
|
|
|
|
server. Where not supported, Xcursor maps the cursor image to a standard X
|
|
|
|
|
cursor and uses the core CreateCursor request.
|
|
|
|
|
|
|
|
|
|
.SS CURSOR FILES
|
|
|
|
|
Xcursor defines a new format for cursors on disk. Each file holds
|
|
|
|
|
one or more cursor images. Each cursor image is tagged with a nominal size
|
|
|
|
|
so that the best size can be selected automatically. Multiple cursors of
|
|
|
|
|
the same nominal size can be loaded together; applications are expected to
|
|
|
|
|
use them as an animated sequence.
|
|
|
|
|
.P
|
|
|
|
|
Cursor files are stored as a header containing a table of contents followed
|
|
|
|
|
by a sequence of chunks. The table of contents indicates the type, subtype
|
|
|
|
|
and position in the file of each chunk. The file header looks like:
|
|
|
|
|
.LP
|
|
|
|
|
.in +.2i
|
|
|
|
|
\fImagic\fP\^: CARD32 'Xcur' (0x58, 0x63, 0x75, 0x72)
|
|
|
|
|
.br
|
|
|
|
|
\fIheader\fP\^: CARD32 bytes in this header
|
|
|
|
|
.br
|
|
|
|
|
\fIversion\fP\^: CARD32 file version number
|
|
|
|
|
.br
|
|
|
|
|
\fIntoc\fP\^: CARD32 number of toc entries
|
2006-10-06 16:22:52 -07:00
|
|
|
.br
|
2003-11-14 16:48:48 +00:00
|
|
|
\fItoc\fP\^: LISTofTOC table of contents
|
|
|
|
|
.in -.2i
|
|
|
|
|
.P
|
|
|
|
|
Each table of contents entry looks like:
|
|
|
|
|
.LP
|
|
|
|
|
.in +.2i
|
|
|
|
|
\fItype\fP\^: CARD32 entry type
|
2006-10-06 16:22:52 -07:00
|
|
|
.br
|
2003-11-14 16:48:48 +00:00
|
|
|
\fIsubtype\fP\^: CARD32 type-specific label - size for images
|
2006-10-06 16:22:52 -07:00
|
|
|
.br
|
2003-11-14 16:48:48 +00:00
|
|
|
\fIposition\fP\^: CARD32 absolute byte position of table in file
|
|
|
|
|
.in -.2i
|
|
|
|
|
.P
|
|
|
|
|
.P
|
|
|
|
|
Each chunk in the file has set of common header fields followed by
|
|
|
|
|
additional type-specific fields:
|
|
|
|
|
.LP
|
|
|
|
|
.in +.2i
|
|
|
|
|
\fIheader\fP\^: CARD32 bytes in chunk header (including type-specific fields)
|
|
|
|
|
.br
|
|
|
|
|
\fItype\fP\^: CARD32 must match type in TOC for this chunk
|
|
|
|
|
.br
|
|
|
|
|
\fIsubtype\fP\^: CARD32 must match subtype in TOC for this chunk
|
|
|
|
|
.br
|
|
|
|
|
\fIversion\fP\^: CARD32 version number for this chunk type
|
|
|
|
|
.in -.2i
|
|
|
|
|
.P
|
|
|
|
|
There are currently two chunk types defined for cursor files; comments and
|
|
|
|
|
images. Comments look like:
|
|
|
|
|
.LP
|
|
|
|
|
.in +.2i
|
|
|
|
|
\fIheader\fP\^: 20 Comment headers are 20 bytes
|
|
|
|
|
.br
|
|
|
|
|
\fItype\fP\^: 0xfffe0001 Comment type is 0xfffe0001
|
|
|
|
|
.br
|
|
|
|
|
\fIsubtype\fP\^: { 1 (COPYRIGHT), 2 (LICENSE), 3 (OTHER) }
|
|
|
|
|
.br
|
|
|
|
|
\fIversion\fP\^: 1
|
|
|
|
|
.br
|
|
|
|
|
\fIlength\fP\^: CARD32 byte length of UTF-8 string
|
|
|
|
|
.br
|
|
|
|
|
\fIstring\fP\^: LISTofCARD8 UTF-8 string
|
|
|
|
|
.in -.2i
|
|
|
|
|
.P
|
|
|
|
|
Images look like:
|
|
|
|
|
.LP
|
|
|
|
|
.in +.2i
|
|
|
|
|
\fIheader\fP\^: 36 Image headers are 36 bytes
|
|
|
|
|
.br
|
|
|
|
|
\fItype\fP\^: 0xfffd0002 Image type is 0xfffd0002
|
|
|
|
|
.br
|
|
|
|
|
\fIsubtype\fP\^: CARD32 Image subtype is the nominal size
|
|
|
|
|
.br
|
|
|
|
|
\fIversion\fP\^: 1
|
|
|
|
|
.br
|
|
|
|
|
\fIwidth\fP\^: CARD32 Must be less than or equal to 0x7fff
|
|
|
|
|
.br
|
|
|
|
|
\fIheight\fP\^: CARD32 Must be less than or equal to 0x7fff
|
|
|
|
|
.br
|
|
|
|
|
\fIxhot\fP\^: CARD32 Must be less than or equal to width
|
|
|
|
|
.br
|
|
|
|
|
\fIyhot\fP\^: CARD32 Must be less than or equal to height
|
|
|
|
|
.br
|
|
|
|
|
\fIdelay\fP\^: CARD32 Delay between animation frames in milliseconds
|
|
|
|
|
.br
|
|
|
|
|
\fIpixels\fP\^: LISTofCARD32 Packed ARGB format pixels
|
|
|
|
|
.in -.2i
|
|
|
|
|
|
|
|
|
|
.SS THEMES
|
|
|
|
|
Xcursor (mostly) follows the freedesktop.org spec for theming icons. The
|
2007-08-21 19:33:00 -07:00
|
|
|
default search path it uses is __XCURSORPATH__. Within each of these
|
2006-08-24 18:42:03 -07:00
|
|
|
directories, it searches for a directory using the theme name. Within the
|
2003-11-14 16:48:48 +00:00
|
|
|
theme directory, it looks for cursor files in the 'cursors' subdirectory.
|
|
|
|
|
It uses the first cursor file found along the path.
|
|
|
|
|
.PP
|
|
|
|
|
If necessary, Xcursor also looks for a "index.theme" file in each theme
|
|
|
|
|
directory to find inherited themes and searches along the path for those
|
|
|
|
|
themes as well.
|
|
|
|
|
.PP
|
|
|
|
|
If no theme is set, or if no cursor is found for the specified theme,
|
|
|
|
|
Xcursor checks the "default" theme.
|
|
|
|
|
|
|
|
|
|
.SH DATATYPES
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
.B XcursorImage
|
|
|
|
|
holds a single cursor image in memory. Each pixel in the cursor is a 32-bit
|
|
|
|
|
value containing ARGB with A in the high byte.
|
|
|
|
|
.sp
|
|
|
|
|
.nf
|
|
|
|
|
.ft CR
|
|
|
|
|
typedef struct _XcursorImage {
|
2005-10-13 02:22:47 +00:00
|
|
|
XcursorDim size; /\(** nominal size for matching */
|
|
|
|
|
XcursorDim width; /\(** actual width */
|
|
|
|
|
XcursorDim height; /\(** actual height */
|
|
|
|
|
XcursorDim xhot; /\(** hot spot x (must be inside image) */
|
|
|
|
|
XcursorDim yhot; /\(** hot spot y (must be inside image) */
|
|
|
|
|
XcursorPixel *pixels; /\(** pointer to pixels */
|
2003-11-14 16:48:48 +00:00
|
|
|
} XcursorImage;
|
|
|
|
|
.ft
|
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
.B XcursorImages
|
|
|
|
|
holds multiple XcursorImage structures. They're all freed when the
|
|
|
|
|
XcursorImages is freed.
|
|
|
|
|
.sp
|
|
|
|
|
.nf
|
|
|
|
|
.ft CR
|
|
|
|
|
typedef struct _XcursorImages {
|
2005-10-13 02:22:47 +00:00
|
|
|
int nimage; /\(** number of images */
|
|
|
|
|
XcursorImage **images; /\(** array of XcursorImage pointers */
|
2003-11-14 16:48:48 +00:00
|
|
|
} XcursorImages;
|
|
|
|
|
.ft
|
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
.B XcursorCursors
|
|
|
|
|
Holds multiple Cursor objects. They're all freed when the XcursorCursors is
|
|
|
|
|
freed. These are reference counted so that multiple XcursorAnimate
|
|
|
|
|
structures can use the same XcursorCursors.
|
|
|
|
|
.sp
|
|
|
|
|
.nf
|
|
|
|
|
.ft CR
|
|
|
|
|
typedef struct _XcursorCursors {
|
2005-10-13 02:22:47 +00:00
|
|
|
Display *dpy; /\(** Display holding cursors */
|
|
|
|
|
int ref; /\(** reference count */
|
|
|
|
|
int ncursor; /\(** number of cursors */
|
|
|
|
|
Cursor *cursors; /\(** array of cursors */
|
2003-11-14 16:48:48 +00:00
|
|
|
} XcursorCursors;
|
|
|
|
|
.ft
|
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
.B XcursorAnimate
|
|
|
|
|
References a set of cursors and a sequence within that set. Multiple
|
|
|
|
|
XcursorAnimate structures may reference the same XcursorCursors; each
|
|
|
|
|
holds a reference which is removed when the XcursorAnimate is freed.
|
|
|
|
|
.sp
|
|
|
|
|
.nf
|
|
|
|
|
.ft CR
|
|
|
|
|
typedef struct _XcursorAnimate {
|
2005-10-13 02:22:47 +00:00
|
|
|
XcursorCursors *cursors; /\(** list of cursors to use */
|
|
|
|
|
int sequence; /\(** which cursor is next */
|
2003-11-14 16:48:48 +00:00
|
|
|
} XcursorAnimate;
|
|
|
|
|
.ft
|
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
.B XcursorFile
|
|
|
|
|
Xcursor provides an abstract API for accessing the file data. Xcursor
|
|
|
|
|
provides a stdio implementation of this abstract API; applications
|
|
|
|
|
are free to create additional implementations. These functions
|
|
|
|
|
parallel the stdio functions in return value and expected argument values;
|
|
|
|
|
the read and write functions flip the arguments around to match the POSIX
|
|
|
|
|
versions.
|
|
|
|
|
.sp
|
|
|
|
|
.nf
|
|
|
|
|
.ft CR
|
|
|
|
|
typedef struct _XcursorFile {
|
|
|
|
|
void *closure;
|
|
|
|
|
int (*read) (XcursorFile *file, unsigned char *buf, int len);
|
|
|
|
|
int (*write) (XcursorFile *file, unsigned char *buf, int len);
|
|
|
|
|
int (*seek) (XcursorFile *file, long offset, int whence);
|
|
|
|
|
};
|
|
|
|
|
.ft
|
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
.SH FUNCTIONS
|
|
|
|
|
|
|
|
|
|
.SS Object Management
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImage *XcursorImageCreate (int \fIwidth\fP, int \fIheight\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
void XcursorImageDestroy (XcursorImage *\fIimage\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Allocate and free images. On allocation, the hotspot and the pixels are
|
2021-03-15 19:00:14 -04:00
|
|
|
left uninitialized.
|
|
|
|
|
The size is set to the maximum of \fIwidth\fP and \fIheight\fP.
|
2003-11-14 16:48:48 +00:00
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImages *XcursorImagesCreate (int \fIsize\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
void XcursorImagesDestroy (XcursorImages *\fIimages\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Allocate and free arrays to hold multiple cursor images. On allocation,
|
2021-03-15 19:00:14 -04:00
|
|
|
\fInimage\fP is set to zero.
|
2003-11-14 16:48:48 +00:00
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorCursors *XcursorCursorsCreate (Display *\fIdpy\fP, int \fIsize\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
void XcursorCursorsDestroy (XcursorCursors *\fIcursors\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Allocate and free arrays to hold multiple cursors. On allocation,
|
2021-03-15 19:00:14 -04:00
|
|
|
\fIncursor\fP is set to zero, \fIref\fP is set to one.
|
2003-11-14 16:48:48 +00:00
|
|
|
|
|
|
|
|
.SS Reading and writing images.
|
|
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImage *XcursorXcFileLoadImage (XcursorFile *\fIfile\fP, int \fIsize\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImages *XcursorXcFileLoadImages (XcursorFile *\fIfile\fP, int \fIsize\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImages *XcursorXcFileLoadAllImages (XcursorFile *\fIfile\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorBool XcursorXcFileLoad (
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorFile *\fIfile\fP,
|
|
|
|
|
XcursorComments **\fIcommentsp\fP,
|
|
|
|
|
XcursorImages **\fIimagesp\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorBool XcursorXcFileSave (
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorFile *\fIfile\fP,
|
|
|
|
|
const XcursorComments *\fIcomments\fP,
|
|
|
|
|
const XcursorImages *\fIimages\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
These read and write cursors from an XcursorFile handle. After reading, the
|
|
|
|
|
file pointer will be left at some random place in the file.
|
2011-09-16 21:26:17 -07:00
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImage *XcursorFileLoadImage (FILE *\fIfile\fP, int \fIsize\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImages *XcursorFileLoadImages (FILE *\fIfile\fP, int \fIsize\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImages *XcursorFileLoadAllImages (FILE *\fIfile\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorBool XcursorFileLoad (
|
|
|
|
|
FILE *\fIfile\fP,
|
|
|
|
|
XcursorComments **\fIcommentsp\fP,
|
|
|
|
|
XcursorImages **\fIimagesp\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorBool XcursorFileSaveImages (
|
|
|
|
|
FILE *\fIfile\fP,
|
|
|
|
|
const XcursorImages *\fIimages\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorBool XcursorFileSave (
|
2021-03-15 19:00:14 -04:00
|
|
|
FILE * \fIfile\fP,
|
|
|
|
|
const XcursorComments *\fIcomments\fP,
|
|
|
|
|
const XcursorImages *\fIimages\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
These read and write cursors from a stdio FILE handle. Writing flushes
|
|
|
|
|
before returning so that any errors should be detected.
|
|
|
|
|
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorImage *XcursorFilenameLoadImage (
|
2021-03-15 19:00:14 -04:00
|
|
|
const char *\fIfilename\fP,
|
|
|
|
|
int \fIsize\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
|
|
|
|
XcursorImages *XcursorFilenameLoadImages (
|
2021-03-15 19:00:14 -04:00
|
|
|
const char *\fIfilename\fP,
|
|
|
|
|
int \fIsize\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorImages *XcursorFilenameLoadAllImages (const char *\fIfile\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorBool XcursorFilenameLoad (
|
2021-03-15 19:00:14 -04:00
|
|
|
const char *\fIfile\fP,
|
|
|
|
|
XcursorComments **\fIcommentsp\fP,
|
|
|
|
|
XcursorImages **\fIimagesp\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorBool XcursorFilenameSaveImages (
|
2021-03-15 19:00:14 -04:00
|
|
|
const char *\fIfilename\fP,
|
|
|
|
|
const XcursorImages *\fIimages\fP)
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorBool XcursorFilenameSave (
|
2021-03-15 19:00:14 -04:00
|
|
|
const char *\fIfile\fP,
|
|
|
|
|
const XcursorComments *\fIcomments\fP,
|
|
|
|
|
const XcursorImages *\fIimages\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
These parallel the stdio FILE interfaces above, but take filenames.
|
|
|
|
|
|
|
|
|
|
.SS Reading library images
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorImage *XcursorLibraryLoadImage (
|
2021-03-15 19:00:14 -04:00
|
|
|
const char *\fIname\fP,
|
|
|
|
|
const char *\fItheme\fP,
|
|
|
|
|
int \fIsize\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
|
|
|
|
XcursorImages *XcursorLibraryLoadImages (
|
2021-03-15 19:00:14 -04:00
|
|
|
const char *\fIname\fP,
|
|
|
|
|
const char *\fItheme\fP,
|
2021-03-14 19:24:48 -04:00
|
|
|
int size)
|
|
|
|
|
.NE
|
2021-03-15 19:00:14 -04:00
|
|
|
These search the library path, loading the first file found.
|
|
|
|
|
If \fItheme\fP is not NULL,
|
|
|
|
|
these functions first try appending -theme to \fIname\fP and
|
|
|
|
|
then \fIname\fP alone.
|
2003-11-14 16:48:48 +00:00
|
|
|
|
|
|
|
|
.SS Cursor APIs
|
|
|
|
|
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
Cursor XcursorFilenameLoadCursor (
|
2021-03-15 19:00:14 -04:00
|
|
|
Display *\fIdpy\fP,
|
|
|
|
|
const char *\fIfile\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
|
|
|
|
XcursorCursors *XcursorFilenameLoadCursors (
|
2021-03-15 19:00:14 -04:00
|
|
|
Display *\fIdpy\fP,
|
|
|
|
|
const char *\fIfile\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
These load cursors from the specified file.
|
|
|
|
|
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
Cursor XcursorLibraryLoadCursor (
|
2021-03-15 19:00:14 -04:00
|
|
|
Display *\fIdpy\fP,
|
|
|
|
|
const char *\fIname\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
|
|
|
|
XcursorCursors *XcursorLibraryLoadCursors (
|
2021-03-15 19:00:14 -04:00
|
|
|
Display *\fIdpy\fP,
|
|
|
|
|
const char *\fIname\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2021-03-15 19:00:14 -04:00
|
|
|
These load cursors using the specified library \fIname\fP. The theme
|
2003-11-14 16:48:48 +00:00
|
|
|
comes from the display.
|
|
|
|
|
|
|
|
|
|
.SS X Cursor Name APIs
|
|
|
|
|
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
XcursorImage *XcursorShapeLoadImage (
|
2021-03-15 19:00:14 -04:00
|
|
|
unsigned int \fIshape\fP,
|
|
|
|
|
const char *\fItheme\fP,
|
|
|
|
|
int \fIsize\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
|
|
|
|
XcursorImages *XcursorShapeLoadImages (
|
2021-03-15 19:00:14 -04:00
|
|
|
unsigned int \fIshape\fP,
|
|
|
|
|
const char *\fItheme\fP,
|
|
|
|
|
int \fIsize\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2021-03-15 19:00:14 -04:00
|
|
|
These map \fIshape\fP to a library name using the standard X cursor names and
|
2003-11-14 16:48:48 +00:00
|
|
|
then load the images.
|
|
|
|
|
|
2021-03-14 17:18:59 -04:00
|
|
|
.NS
|
2021-03-14 19:24:48 -04:00
|
|
|
Cursor XcursorShapeLoadCursor (
|
2021-03-15 19:00:14 -04:00
|
|
|
Display *\fIdpy\fP,
|
|
|
|
|
unsigned int \fIshape\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
|
|
|
|
XcursorCursors *XcursorShapeLoadCursors (
|
2021-03-15 19:00:14 -04:00
|
|
|
Display *\fIdpy\fP,
|
|
|
|
|
unsigned int \fIshape\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2021-03-15 19:00:14 -04:00
|
|
|
These map \fIshape\fP to a library name and then load the cursors.
|
2003-11-14 16:48:48 +00:00
|
|
|
|
|
|
|
|
.SS Display Information APIs
|
|
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorBool XcursorSupportsARGB (Display *\fIdpy\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Returns whether the display supports ARGB cursors or whether cursors will be
|
|
|
|
|
mapped to a core X cursor.
|
|
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorBool XcursorSetDefaultSize (Display *\fIdpy\fP, int \fIsize\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Sets the default size for cursors on the specified display. When loading
|
2007-08-21 19:45:35 -07:00
|
|
|
cursors, those whose nominal size is closest to this size will be preferred.
|
2003-11-14 16:48:48 +00:00
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
int XcursorGetDefaultSize (Display *\fIdpy\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Gets the default cursor size.
|
|
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
XcursorBool XcursorSetTheme (Display *\fIdpy\fP, const char *\fItheme\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Sets the current theme name.
|
|
|
|
|
|
2021-03-14 19:24:48 -04:00
|
|
|
.NS
|
2021-03-15 19:00:14 -04:00
|
|
|
char *XcursorGetTheme (Display *\fIdpy\fP)
|
2021-03-14 19:24:48 -04:00
|
|
|
.NE
|
2003-11-14 16:48:48 +00:00
|
|
|
Gets the current theme name.
|
|
|
|
|
|
2007-08-21 19:45:35 -07:00
|
|
|
.SH "ENVIRONMENT VARIABLES"
|
2021-03-11 20:17:08 -05:00
|
|
|
Environment variables can be used to override resource settings,
|
|
|
|
|
which in turn override compiled-in default values.
|
|
|
|
|
.PP
|
|
|
|
|
Some of the environment variables recognized by Xcursor are booleans,
|
|
|
|
|
specified as follows:
|
|
|
|
|
.RS 3
|
|
|
|
|
.TP 5
|
|
|
|
|
\fItrue\fP for \*(``t\*('', \*(``1\*('', \*(``y\*('' or \*(``on\*(''
|
|
|
|
|
.TP 5
|
|
|
|
|
\fIfalse\fP for \*(``f\*('', \*(``0\*('', \*(``n\*('' or \*(``off\*(''
|
|
|
|
|
.RE
|
|
|
|
|
.PP
|
|
|
|
|
Xcursor ignores other values for these booleans.
|
|
|
|
|
.TP 15
|
|
|
|
|
.B HOME
|
|
|
|
|
Xcursor interprets \*(``~\*('' in the search list as the home directory,
|
|
|
|
|
using this variable rather than the password database.
|
|
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_ANIM
|
|
|
|
|
If the display supports the Render CreateCursor request,
|
|
|
|
|
and the Render feature is enabled,
|
|
|
|
|
disable \fIanimated\fP cursors if the environment variable is \fIfalse\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If the environment variable is not given,
|
|
|
|
|
Xcursor uses the resource \fBXcursor.anim\fP.
|
|
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_CORE
|
|
|
|
|
If the display supports the Render CreateCursor request
|
|
|
|
|
disable the Render feature if the environment variable is \fIfalse\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If the environment variable is not given,
|
|
|
|
|
Xcursor uses the resource \fBXcursor.core\fP.
|
|
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_DISCOVER
|
|
|
|
|
If the variable is set, Xcursor turns on a logging feature.
|
|
|
|
|
It displays the hash value and the image so that users can see which
|
|
|
|
|
cursor name is associated with each image.
|
|
|
|
|
.IP
|
|
|
|
|
There is no corresponding resource setting.
|
|
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_DITHER
|
|
|
|
|
This variable sets the desired \fIdither\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If the environment variable is not given,
|
|
|
|
|
Xcursor uses the resource \fBXcursor.dither\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If neither environment variable or resource is found,
|
|
|
|
|
Xcursor uses \*(``threshold\*(''
|
|
|
|
|
.IP
|
|
|
|
|
These are the recognized values:
|
|
|
|
|
.RS 18
|
|
|
|
|
.TP 5
|
|
|
|
|
.B diffuse
|
|
|
|
|
.TP 5
|
|
|
|
|
.B median
|
|
|
|
|
.TP 5
|
|
|
|
|
.B ordered
|
|
|
|
|
.TP 5
|
|
|
|
|
.B threshold
|
|
|
|
|
.RE
|
2007-08-21 19:45:35 -07:00
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_PATH
|
2021-03-11 20:17:08 -05:00
|
|
|
This variable sets the list of paths to look for cursors in,
|
|
|
|
|
rather than the compiled-in default list.
|
|
|
|
|
.IP
|
2007-08-21 19:45:35 -07:00
|
|
|
Directories in this path are separated by colons (:).
|
2021-03-11 20:17:08 -05:00
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_SIZE
|
|
|
|
|
This variable sets the desired cursor size, in pixels.
|
|
|
|
|
.IP
|
|
|
|
|
If the environment variable is not given,
|
|
|
|
|
Xcursor tries the resource \fBXcursor.size\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If no size is given, whether by environment variable or resource setting,
|
|
|
|
|
Xcursor next tries the \fBXft.dpi\fP resource setting to guess
|
|
|
|
|
the size of a 16-point cursor.
|
|
|
|
|
.IP
|
|
|
|
|
Finally, if \fBXft.dpi\fP is not set,
|
|
|
|
|
Xcursor uses the display height,
|
|
|
|
|
dividing by 48 (assuming that the height is 768).
|
|
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_THEME
|
|
|
|
|
This variable selects the desired \fItheme\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If the environment variable is not given,
|
|
|
|
|
Xcursor tries the resource \fBXcursor.theme\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If neither environment variable or resource is found,
|
|
|
|
|
Xcursor uses the \fIdefault\fP theme.
|
|
|
|
|
.TP 15
|
|
|
|
|
.B XCURSOR_THEME_CORE
|
|
|
|
|
Enables themes for core cursors if the environment variable is \fItrue\fP.
|
|
|
|
|
.IP
|
|
|
|
|
If the environment variable is not given,
|
|
|
|
|
Xcursor tries the resource \fBXcursor.theme_core\fP.
|
2003-11-14 16:48:48 +00:00
|
|
|
.SH RESTRICTIONS
|
|
|
|
|
.B Xcursor
|
|
|
|
|
will probably change radically in the future; weak attempts will be made to
|
|
|
|
|
retain some level of source-file compatibility.
|
|
|
|
|
|
|
|
|
|
.SH AUTHOR
|
2004-04-23 18:43:40 +00:00
|
|
|
Keith Packard
|