Path: blob/master/thirdparty/linuxbsd_headers/wayland/wayland-cursor.h
9898 views
/*1* Copyright © 2012 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining4* a copy of this software and associated documentation files (the5* "Software"), to deal in the Software without restriction, including6* without limitation the rights to use, copy, modify, merge, publish,7* distribute, sublicense, and/or sell copies of the Software, and to8* permit persons to whom the Software is furnished to do so, subject to9* the following conditions:10*11* The above copyright notice and this permission notice (including the12* next paragraph) shall be included in all copies or substantial13* portions of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,16* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF17* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND18* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS19* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN20* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN21* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE22* SOFTWARE.23*/2425#ifndef WAYLAND_CURSOR_H26#define WAYLAND_CURSOR_H2728#include <stdint.h>2930#ifdef __cplusplus31extern "C" {32#endif3334struct wl_cursor_theme;35struct wl_buffer;36struct wl_shm;3738/** A still image part of a cursor39*40* Use `wl_cursor_image_get_buffer()` to get the corresponding `struct41* wl_buffer` to attach to your `struct wl_surface`. */42struct wl_cursor_image {43/** Actual width */44uint32_t width;4546/** Actual height */47uint32_t height;4849/** Hot spot x (must be inside image) */50uint32_t hotspot_x;5152/** Hot spot y (must be inside image) */53uint32_t hotspot_y;5455/** Animation delay to next frame (ms) */56uint32_t delay;57};5859/** A cursor, as returned by `wl_cursor_theme_get_cursor()` */60struct wl_cursor {61/** How many images there are in this cursor’s animation */62unsigned int image_count;6364/** The array of still images composing this animation */65struct wl_cursor_image **images;6667/** The name of this cursor */68char *name;69};7071struct wl_cursor_theme *72wl_cursor_theme_load(const char *name, int size, struct wl_shm *shm);7374void75wl_cursor_theme_destroy(struct wl_cursor_theme *theme);7677struct wl_cursor *78wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,79const char *name);8081struct wl_buffer *82wl_cursor_image_get_buffer(struct wl_cursor_image *image);8384int85wl_cursor_frame(struct wl_cursor *cursor, uint32_t time);8687int88wl_cursor_frame_and_duration(struct wl_cursor *cursor, uint32_t time,89uint32_t *duration);9091#ifdef __cplusplus92}93#endif9495#endif969798