AtlatestRepositorysigil-ui
1
/*2
* Copyright © 2012 Intel Corporation3
*4
* Permission is hereby granted, free of charge, to any person obtaining5
* a copy of this software and associated documentation files (the6
* "Software"), to deal in the Software without restriction, including7
* without limitation the rights to use, copy, modify, merge, publish,8
* distribute, sublicense, and/or sell copies of the Software, and to9
* permit persons to whom the Software is furnished to do so, subject to10
* the following conditions:11
*12
* The above copyright notice and this permission notice (including the13
* next paragraph) shall be included in all copies or substantial14
* portions of the Software.15
*16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,17
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF18
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND19
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS20
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN21
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN22
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE23
* SOFTWARE.24
*/26
#ifndef WAYLAND_CURSOR_H27
#define WAYLAND_CURSOR_H29
#include <stdint.h>31
#ifdef __cplusplus32
extern "C" {33
#endif35
struct wl_cursor_theme;36
struct wl_buffer;37
struct wl_shm;39
/** A still image part of a cursor40
*41
* Use `wl_cursor_image_get_buffer()` to get the corresponding `struct42
* wl_buffer` to attach to your `struct wl_surface`. */43
struct wl_cursor_image {44
/** Actual width */45
uint32_t width;47
/** Actual height */48
uint32_t height;50
/** Hot spot x (must be inside image) */51
uint32_t hotspot_x;53
/** Hot spot y (must be inside image) */54
uint32_t hotspot_y;56
/** Animation delay to next frame (ms) */57
uint32_t delay;58
};60
/** A cursor, as returned by `wl_cursor_theme_get_cursor()` */61
struct wl_cursor {62
/** How many images there are in this cursor’s animation */63
unsigned int image_count;65
/** The array of still images composing this animation */66
struct wl_cursor_image **images;68
/** The name of this cursor */69
char *name;70
};72
struct wl_cursor_theme *73
wl_cursor_theme_load(const char *name, int size, struct wl_shm *shm);75
void76
wl_cursor_theme_destroy(struct wl_cursor_theme *theme);78
struct wl_cursor *79
wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,80
const char *name);82
struct wl_buffer *83
wl_cursor_image_get_buffer(struct wl_cursor_image *image);85
int86
wl_cursor_frame(struct wl_cursor *cursor, uint32_t time);88
int89
wl_cursor_frame_and_duration(struct wl_cursor *cursor, uint32_t time,90
uint32_t *duration);92
#ifdef __cplusplus93
}94
#endif96
#endif