]> git.sur5r.net Git - i3/i3/blob - include/xcursor.h
Merge branch 'release-4.16.1'
[i3/i3] / include / xcursor.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * xcursor.c: libXcursor support for themed cursors.
8  *
9  */
10 #pragma once
11
12 #include <config.h>
13
14 #include <xcb/xcb_cursor.h>
15
16 enum xcursor_cursor_t {
17     XCURSOR_CURSOR_POINTER = 0,
18     XCURSOR_CURSOR_RESIZE_HORIZONTAL,
19     XCURSOR_CURSOR_RESIZE_VERTICAL,
20     XCURSOR_CURSOR_TOP_LEFT_CORNER,
21     XCURSOR_CURSOR_TOP_RIGHT_CORNER,
22     XCURSOR_CURSOR_BOTTOM_LEFT_CORNER,
23     XCURSOR_CURSOR_BOTTOM_RIGHT_CORNER,
24     XCURSOR_CURSOR_WATCH,
25     XCURSOR_CURSOR_MOVE,
26     XCURSOR_CURSOR_MAX
27 };
28
29 void xcursor_load_cursors(void);
30 xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c);
31 int xcursor_get_xcb_cursor(enum xcursor_cursor_t c);
32
33 /**
34  * Sets the cursor of the root window to the 'pointer' cursor.
35  *
36  * This function is called when i3 is initialized, because with some login
37  * managers, the root window will not have a cursor otherwise.
38  *
39  * We have a separate xcursor function to use the same X11 connection as the
40  * xcursor_load_cursors() function. If we mix the Xlib and the XCB connection,
41  * races might occur (even though we flush the Xlib connection).
42  *
43  */
44 void xcursor_set_root_cursor(int cursor_id);