Release 1.6.0.
[xtoys] / libxatom.h
1 /* -*-c-*-
2 *
3 * Messing with X atom properties
4 *
5 * (c) 2007 Straylight/Edgeware
6 */
7
8 /*----- Licensing notice --------------------------------------------------*
9 *
10 * This file is part of the Edgeware X tools collection.
11 *
12 * X tools is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * X tools is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with X tools; if not, write to the Free Software Foundation,
24 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 */
26
27 #ifndef LIBXATOM_H
28 #define LIBXATOM_H
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /*----- Header files ------------------------------------------------------*/
35
36 #include <stddef.h>
37
38 #include <X11/Xlib.h>
39
40 /*----- Functions provided ------------------------------------------------*/
41
42 /* --- @xatom_set@ --- *
43 *
44 * Arguments: @Display *d@ = pointer to display
45 * @Window w@ = window to set
46 * @Atom p@ = property to set
47 * @Atom a@ = atom property value
48 *
49 * Returns: ---
50 *
51 * Use: Sets an atom property on a particular window.
52 */
53
54 extern void xatom_set(Display */*d*/, Window /*w*/, Atom /*p*/, Atom /*a*/);
55
56 /* --- @xatom_get@ --- *
57 *
58 * Arguments: @Display *d@ = pointer to display
59 * @Window w@ = window to set
60 * @Atom p@ = property to read
61 *
62 * Returns: Atom which is the value of the property.
63 *
64 * Use: Reads an atom property from a particular window. The value
65 * @None@ is returned if there is no atom value.
66 */
67
68 extern Atom xatom_get(Display */*d*/, Window /*w*/, Atom /*p*/);
69
70 /* --- @xatom_delete@ --- *
71 *
72 * Arguments: @Display *d@ = pointer to display
73 * @Window w@ = window containing atom
74 * @Atom p@ = property to delete
75 *
76 * Returns: ---
77 *
78 * Use: Removes a property from a window.
79 */
80
81 extern void xatom_delete(Display */*d*/, Window /*w*/, Atom /*p*/);
82
83 /* --- @xatom_wait@ --- *
84 *
85 * Arguments: @Display *d@ = pointer to display
86 * @Window w@ = window to watch
87 * @Atom p@ = property to fetch
88 * @const Atom *aa@ = pointer to vector of atoms
89 * @size_t n@ = numer of atoms in vector
90 *
91 * Returns: The matching atom.
92 *
93 * Use: Waits for the given property on the window to match one of
94 * the @aa[i]@.
95 */
96
97 extern Atom xatom_wait(Display */*d*/, Window /*w*/, Atom /*p*/,
98 const Atom */*aa*/, size_t /*n*/);
99
100 /*----- That's all, folks -------------------------------------------------*/
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif