diff options
| author | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2012-05-22 15:39:41 +0300 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-22 15:20:13 -0400 |
| commit | 775002c6c0f841a034a286c756899e6a4371962b (patch) | |
| tree | 6bcca7a35224bfc3c45eeabbb7d813f035732142 /cursor/xcursor.h | |
| parent | shm: Add request for resizing pools (diff) | |
| download | wayland-775002c6c0f841a034a286c756899e6a4371962b.tar wayland-775002c6c0f841a034a286c756899e6a4371962b.tar.gz wayland-775002c6c0f841a034a286c756899e6a4371962b.tar.bz2 wayland-775002c6c0f841a034a286c756899e6a4371962b.tar.lz wayland-775002c6c0f841a034a286c756899e6a4371962b.tar.xz wayland-775002c6c0f841a034a286c756899e6a4371962b.tar.zst wayland-775002c6c0f841a034a286c756899e6a4371962b.zip | |
Introduce libwayland-cursor, a cursor helper library
The purpose of this library is to be the equivalent of libXcursor in
the X world. This library is compatible with X cursor themes and loads
them directly into an shm pool making it easy for the clients to get
buffer for each cursor image.
The code for handling the X cursor theme was taken from libXcursor. The
files cursor/xcursor.[ch] are a stripped down version of that library
containing only the interfaces necessary for implementing the wayland
counterpart.
Diffstat (limited to 'cursor/xcursor.h')
| -rw-r--r-- | cursor/xcursor.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/cursor/xcursor.h b/cursor/xcursor.h new file mode 100644 index 0000000..a39c58e --- /dev/null +++ b/cursor/xcursor.h @@ -0,0 +1,58 @@ +/* + * Copyright © 2002 Keith Packard + * + * 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. + */ + +#ifndef _XCURSOR_H_ +#define _XCURSOR_H_ + +typedef int XcursorBool; +typedef unsigned int XcursorUInt; + +typedef XcursorUInt XcursorDim; +typedef XcursorUInt XcursorPixel; + +typedef struct _XcursorImage { + XcursorUInt version; /* version of the image data */ + 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) */ + XcursorUInt delay; /* animation delay to next frame (ms) */ + XcursorPixel *pixels; /* pointer to pixels */ +} XcursorImage; + +/* + * Other data structures exposed by the library API + */ +typedef struct _XcursorImages { + int nimage; /* number of images */ + XcursorImage **images; /* array of XcursorImage pointers */ + char *name; /* name used to load images */ +} XcursorImages; + +XcursorImages * +XcursorLibraryLoadImages (const char *file, const char *theme, int size); + +void +XcursorImagesDestroy (XcursorImages *images); + +#endif |
