File indexing completed on 2024-05-12 05:31:05

0001 /*
0002  * Copyright © 2002 Keith Packard
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining
0005  * a copy of this software and associated documentation files (the
0006  * "Software"), to deal in the Software without restriction, including
0007  * without limitation the rights to use, copy, modify, merge, publish,
0008  * distribute, sublicense, and/or sell copies of the Software, and to
0009  * permit persons to whom the Software is furnished to do so, subject to
0010  * the following conditions:
0011  *
0012  * The above copyright notice and this permission notice (including the
0013  * next paragraph) shall be included in all copies or substantial
0014  * portions of the Software.
0015  *
0016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0017  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0018  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0019  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
0020  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0021  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0023  * SOFTWARE.
0024  */
0025 
0026 #ifndef XCURSOR_H
0027 #define XCURSOR_H
0028 
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif
0032 
0033 #include <stdint.h>
0034 
0035 typedef int     XcursorBool;
0036 typedef uint32_t    XcursorUInt;
0037 
0038 typedef XcursorUInt XcursorDim;
0039 typedef XcursorUInt XcursorPixel;
0040 
0041 typedef struct _XcursorImage {
0042     XcursorUInt     version;    /* version of the image data */
0043     XcursorDim      size;   /* nominal size for matching */
0044     XcursorDim      width;  /* actual width */
0045     XcursorDim      height; /* actual height */
0046     XcursorDim      xhot;   /* hot spot x (must be inside image) */
0047     XcursorDim      yhot;   /* hot spot y (must be inside image) */
0048     XcursorUInt     delay;  /* animation delay to next frame (ms) */
0049     XcursorPixel    *pixels;    /* pointer to pixels */
0050 } XcursorImage;
0051 
0052 /*
0053  * Other data structures exposed by the library API
0054  */
0055 typedef struct _XcursorImages {
0056     int         nimage; /* number of images */
0057     XcursorImage    **images;   /* array of XcursorImage pointers */
0058 } XcursorImages;
0059 
0060 XcursorImages *
0061 XcursorFileLoadImages (const char *file, int size);
0062 
0063 void
0064 XcursorImagesDestroy (XcursorImages *images);
0065 
0066 #ifdef __cplusplus
0067 }
0068 #endif
0069 
0070 #endif