]> icculus.org git repositories - mikachu/rspanel.git/blob - xprop.h
92e7488aa3f1feb9d05c6cda136c60ff2deaeaf1
[mikachu/rspanel.git] / xprop.h
1 #ifndef rs_prop_h
2 #define rs_prop_h
3
4 struct screen;
5
6 #include <X11/Xlib.h>
7 #include <X11/Xatom.h>
8
9 typedef enum {
10     /* types */
11     UTF8_STRING,
12     /* client properties */
13     KWM_WIN_ICON,
14     WM_STATE,
15     WM_NAME,
16     _MOTIF_WM_HINTS,
17     _NET_WM_STATE,
18     _NET_WM_STATE_SKIP_TASKBAR,
19     _NET_WM_STATE_SHADED,
20     _NET_WM_STATE_BELOW,
21     _NET_WM_STATE_HIDDEN,
22     _NET_WM_DESKTOP,
23     _NET_WM_WINDOW_TYPE,
24     _NET_WM_WINDOW_TYPE_DOCK,
25     _NET_WM_STRUT,
26     _NET_WM_ICON_GEOMETRY,
27     _NET_WM_ICON,
28     _WIN_HINTS,
29     /* root properties */
30     _NET_CLIENT_LIST,
31     _NET_CLIENT_LIST_STACKING,
32     _NET_NUMBER_OF_DESKTOPS,
33     _NET_CURRENT_DESKTOP,
34     _OB_WM_ACTION,
35     _NET_WM_NAME,
36     _NET_ACTIVE_WINDOW,
37     _NET_RESTACK_WINDOW,
38     _OB_FOCUS,
39     XPROP_COUNT,
40 } xprop_t;
41
42 enum {
43     XPROP_REMOVE = 0,
44     XPROP_ADD,
45     XPROP_TOGGLE
46 };
47
48 void  xprop_init(struct screen *sc);
49
50 void* xprop_get_data(struct screen *sc, Window win, xprop_t prop,
51                      Atom type, int *items);
52
53 int   xprop_get_num(struct screen *sc, Window win, xprop_t p);
54 char* xprop_get_utf8(struct screen *sc, Window win, xprop_t p);
55 char* xprop_get_string(struct screen *sc, Window win, xprop_t p);
56
57 void xprop_set_num(struct screen *sc, Window win, xprop_t p, long val);
58 void xprop_set_atom(struct screen *sc, Window win, xprop_t p, xprop_t at);
59
60 void xprop_set_array(struct screen *sc, Window win, xprop_t p,
61                      const long *vals, int num);
62
63 void xprop_set_string(struct screen *sc, Window win, xprop_t p, const char *s);
64
65 #endif