1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
'\" t
.\" Title: xichangeproperty
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 05/04/2023
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "XICHANGEPROPERTY" "libmansuffix" "05/04/2023" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
XIChangeProperty, XIGetProperty, XIDeleteProperty \- change, retrieve or delete a device\*(Aqs property\&.
.SH "SYNOPSIS"
.sp
.nf
#include <X11/extensions/XInput2\&.h>
.fi
.sp
.nf
void XIChangeProperty( Display* dpy,
int deviceid,
Atom property,
Atom type,
int format,
int mode,
unsigned char *data,
int num_items)
.fi
.sp
.nf
void XIDeleteProperty( Display *dpy,
int deviceid,
Atom property)
.fi
.sp
.nf
Status XIGetProperty( Display *dpy,
int deviceid,
Atom property,
long offset,
long length,
Bool delete_property,
Atom type,
Atom *type_return,
int *format_return,
unsigned long *num_items_return,
unsigned long *bytes_after_return,
unsigned char **data)
.fi
.sp
.nf
bytes_after_return
Returns the number of bytes remaining to be read in the property
if a partial read was performed\&.
.fi
.sp
.nf
data
Specifies the property data\&.
.fi
.sp
.nf
display
Specifies the connection to the X server\&.
.fi
.sp
.nf
delete_property
Specifies a Boolean value that determines whether the property
is to be deleted\&.
.fi
.sp
.nf
deviceid
The device to list the properties for\&.
.fi
.sp
.nf
format
Specifies whether the data should be viewed as a list of
8\-bit, 16\-bit, or 32\-bit quantities\&. Possible values are 8,
16, and 32\&. This information allows the X server to correctly
perform byte\-swap operations as necessary\&. If the
format is 16\-bit or 32\-bit, you must explicitly cast your
data pointer to an (unsigned char *) in the call to
XIChangeProperty\&.
.fi
.sp
.nf
format_return
Returns the actual format of the property\&.
.fi
.sp
.nf
length
Specifies the length in 32\-bit multiples of the data to be
retrieved\&.
.fi
.sp
.nf
offset
Specifies the offset in the specified property (in 32\-bit
quantities) where the data is to be retrieved\&.
.fi
.sp
.nf
mode
One of XIPropModeAppend, XIPropModePrepend or XIPropModeReplace\&.
.fi
.sp
.nf
num_items
Number of items in data in the format specified\&.
.fi
.sp
.nf
nitems_return
Returns the actual number of 8\-bit, 16\-bit, or 32\-bit items
stored in data\&.
.fi
.sp
.nf
property
Specifies the property name\&.
.fi
.sp
.nf
type
Specifies the type of the property\&. The X server does not
interpret the type but simply passes it back to an application
that later calls XIGetProperty\&.
.fi
.sp
.nf
type_return
Returns the atom identifier that defines the actual type of
the property\&.
.fi
.SH "DESCRIPTION"
.sp
The XIGetProperty function returns the actual type of the property; the actual format of the property; the number of 8\-bit, 16\-bit, or 32\-bit items transferred; the number of bytes remaining to be read in the property; and a pointer to the data actually returned\&. XIGetProperty sets the return arguments as follows:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If the specified property does not exist for the specified device, XIGetProperty returns None to actual_type_return and the value zero to actual_format_return and bytes_after_return\&. The nitems_return argument is empty\&. In this case, the delete argument is ignored\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If the specified property exists but its type does not match the specified type, XIGetProperty returns the actual property type to actual_type_return, the actual property format (never zero) to actual_format_return, and the property length in bytes (even if the actual_format_return is 16 or 32) to bytes_after_return\&. It also ignores the delete argument\&. The nitems_return argument is empty\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If the specified property exists and either you assign XIAnyPropertyType to the req_type argument or the specified type matches the actual property type, XIGetProperty returns the actual property type to actual_type_return and the actual property format (never zero) to actual_format_return\&. It also returns a value to bytes_after_return and nitems_return, by defining the following values:
.sp
.if n \{\
.RS 4
.\}
.nf
N = length of the stored property in bytes
I = 4 * offset
T = N \- I
L = MINIMUM(T, 4 * length)
A = N \- (I + L)
.fi
.if n \{\
.RE
.\}
.RE
.sp
The returned value starts at byte index I in the property (indexing from zero), and its length in bytes is L\&. If the value for long_offset causes L to be negative, a BadValue error results\&. The value of bytes_after_return is A, giving the number of trailing unread bytes in the stored property\&.
.sp
If the returned format is 8, the returned data is represented as a char array\&. If the returned format is 16, the returned data is represented as a uint16_t array and should be cast to that type to obtain the elements\&. If the returned format is 32, the returned data is represented as a uint32_t array and should be cast to that type to obtain the elements\&.
.sp
XIGetProperty always allocates one extra byte in prop_return (even if the property is zero length) and sets it to zero so that simple properties consisting of characters do not have to be copied into yet another string before use\&.
.sp
If delete is True and bytes_after_return is zero, XIGetProperty deletes the property from the window and generates an XIPropertyNotify event on the window\&.
.sp
The function returns Success if it executes successfully\&. To free the resulting data, use XFree\&.
.sp
XIGetProperty can generate BadAtom, BadValue, and BadWindow errors\&.
.sp
The XIChangeProperty function alters the property for the specified device and causes the X server to generate a XIPropertyNotify event for that device\&. XIChangeProperty performs the following:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If mode is XIPropModeReplace, XIChangeProperty discards the previous property value and stores the new data\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If mode is XIPropModePrepend or XIPropModeAppend, XIChangeProperty inserts the specified data before the beginning of the existing data or onto the end of the existing data, respectively\&. The type and format must match the existing property value, or a BadMatch error results\&. If the property is undefined, it is treated as defined with the correct type and format with zero\-length data\&.
.RE
.sp
If the specified format is 8, the property data must be a char array\&. If the specified format is 16, the property data must be a uint16_t array\&. If the specified format is 32, the property data must be a uint32_t array\&.
.sp
The lifetime of a property is not tied to the storing client\&. Properties remain until explicitly deleted, until the device is removed, or until the server resets\&. The maximum size of a property is server dependent and can vary dynamically depending on the amount of memory the server has available\&. (If there is insufficient space, a BadAlloc error results\&.)
.sp
XIChangeProperty can generate BadAlloc, BadAtom, BadMatch, BadValue, and BadDevice errors\&.
.sp
The XIDeleteProperty function deletes the specified property only if the property was defined on the specified device and causes the X server to generate a XIPropertyNotify event for the device unless the property does not exist\&.
.sp
XIDeleteProperty can generate BadAtom and BadDevice errors\&.
.SH "DIAGNOSTICS"
.sp
BadAlloc The server failed to allocate the requested resource or server memory\&.
.sp
BadAtom A value for an Atom argument does not name a defined Atom\&.
.sp
BadValue Some numeric value falls outside the range of values accepted by the request\&. Unless a specific range is specified for an argument, the full range defined by the argument\(cqs type is accepted\&. Any argument defined as a set of alternatives can generate this error\&.
.sp
BadDevice An invalid device was specified\&. The device does not exist\&.
.sp
BadAtom An invalid property was specified\&. The property does not exist\&.
.SH "BUGS"
.sp
.if n \{\
.RS 4
.\}
.nf
The protocol headers for XI 2\&.0 did not provide
XIAnyPropertyType, XIPropModeReplace, XIPropModePrepend or
XIPropModeAppend\&. Use AnyPropertyType, PropModeReplace,
PropModePrepend and PropModeAppend instead, respectively\&.
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp
XIListProperties(libmansuffix)
|