XGetDeviceProperty.txt revision c27c18e8
1c27c18e8SmrgXGETDEVICEPROPERTY(libmansuffix)
2c27c18e8Smrg================================
3c27c18e8Smrg
4c27c18e8SmrgNAME
5c27c18e8Smrg----
6c27c18e8Smrg
7c27c18e8Smrg   XGetDeviceProperty, XChangeDeviceProperty,
8c27c18e8Smrg   XDeleteDeviceProperty - Get, change or delete a device's
9c27c18e8Smrg   property.
10c27c18e8Smrg
11c27c18e8SmrgSYNOPSIS
12c27c18e8Smrg--------
13c27c18e8Smrg
14c27c18e8Smrg   #include <X11/extensions/XInput.h>
15c27c18e8Smrg 
16c27c18e8Smrg   int XGetDeviceProperty( Display *display,
17c27c18e8Smrg                           XDevice *device,
18c27c18e8Smrg                           Atom property,
19c27c18e8Smrg                           long offset,
20c27c18e8Smrg                           long length,
21c27c18e8Smrg                           Bool delete,
22c27c18e8Smrg                           Bool pending,
23c27c18e8Smrg                           Atom req_type,
24c27c18e8Smrg                           Atom *actual_type_return,
25c27c18e8Smrg                           int *actual_format_return,
26c27c18e8Smrg                           unsigned long *nitems_return,
27c27c18e8Smrg                           unsigned long *bytes_after_return,
28c27c18e8Smrg                           unsigned char **prop_return)
29c27c18e8Smrg
30c27c18e8Smrg   void XChangeDeviceProperty( Display *display,
31c27c18e8Smrg                               XDevice *device,
32c27c18e8Smrg                               Atom property,
33c27c18e8Smrg                               Atom type,
34c27c18e8Smrg                               int format,
35c27c18e8Smrg                               int mode,
36c27c18e8Smrg                               const char *data,
37c27c18e8Smrg                               int nelements)
38c27c18e8Smrg
39c27c18e8Smrg   void XDeleteDeviceProperty( Display *display,
40c27c18e8Smrg                               XDevice *device,
41c27c18e8Smrg                               Atom property)
42c27c18e8Smrg
43c27c18e8Smrg
44c27c18e8Smrg   actual_type_return
45c27c18e8Smrg          Returns an atom identifier that defines the actual type
46c27c18e8Smrg          of the property.
47c27c18e8Smrg
48c27c18e8Smrg   actual_format_return
49c27c18e8Smrg          Returns the actual format of the property.
50c27c18e8Smrg
51c27c18e8Smrg   bytes_after_return
52c27c18e8Smrg          Returns the number of bytes remaining to be read in the
53c27c18e8Smrg          property if a partial read was performed.
54c27c18e8Smrg
55c27c18e8Smrg   data
56c27c18e8Smrg          Specifies the property data.
57c27c18e8Smrg
58c27c18e8Smrg   delete
59c27c18e8Smrg          Specifies a Boolean value that determines whether the
60c27c18e8Smrg          property is deleted.
61c27c18e8Smrg
62c27c18e8Smrg   display
63c27c18e8Smrg          Specifies the connection to the X server.
64c27c18e8Smrg
65c27c18e8Smrg   device
66c27c18e8Smrg          The device to grab.
67c27c18e8Smrg
68c27c18e8Smrg   format
69c27c18e8Smrg          Specifies whether the data should be viewed as a list of
70c27c18e8Smrg          8-bit, 16-bit, or 32-bit quantities. Possible values are
71c27c18e8Smrg          8, 16, and 32. This information allows the X server to
72c27c18e8Smrg          correctly perform byte-swap operations as necessary. If
73c27c18e8Smrg          the format is 16-bit or 32-bit, you must explicitly cast
74c27c18e8Smrg          the data pointer to an (unsigned char*) in the call to
75c27c18e8Smrg          XChangeDeviceProperty.
76c27c18e8Smrg
77c27c18e8Smrg   length
78c27c18e8Smrg          Specifies the length in 32-bit multiplies of the data to
79c27c18e8Smrg          be retrieved.
80c27c18e8Smrg
81c27c18e8Smrg   mode
82c27c18e8Smrg          Specifies the mode of operation. You can pass
83c27c18e8Smrg          PropModeReplace, PropModePrepend, or PropModeAppend.
84c27c18e8Smrg
85c27c18e8Smrg   nelements
86c27c18e8Smrg          Specifies the number of elements in data.
87c27c18e8Smrg
88c27c18e8Smrg   nitems_return
89c27c18e8Smrg          Returns the actual number of 8-bit, 16-bit, or 32-bit
90c27c18e8Smrg          items stored in the prop_return array.
91c27c18e8Smrg
92c27c18e8Smrg   num_values
93c27c18e8Smrg          Specifies the number of elements in the values list.
94c27c18e8Smrg
95c27c18e8Smrg   offset
96c27c18e8Smrg          Specifies the offset in the specified property (in
97c27c18e8Smrg          32-bit quantities) where the data is to be retrieved.
98c27c18e8Smrg
99c27c18e8Smrg   pending
100c27c18e8Smrg          Specifies whether to retrieve the pending state of the
101c27c18e8Smrg          property or the current state.
102c27c18e8Smrg
103c27c18e8Smrg   property
104c27c18e8Smrg          Specifies the property to modify or query.
105c27c18e8Smrg
106c27c18e8Smrg   prop_return
107c27c18e8Smrg          Returns the data in the specified format. If the
108c27c18e8Smrg          returned format is 8, the returned data is represented
109c27c18e8Smrg          as a char array. If the returned format is 16, the
110c27c18e8Smrg          returned data is represented as an array of short int
111c27c18e8Smrg          type and should be cast to that type to obtain the
112c27c18e8Smrg          elements. If the returned format is 32, the property
113c27c18e8Smrg          data will be stored as an array of longs (which in a
114c27c18e8Smrg          64-bit application will be 64-bit values that are padded
115c27c18e8Smrg          in the upper 4 bytes).
116c27c18e8Smrg
117c27c18e8Smrg   req_type
118c27c18e8Smrg          Specifies the atom identifier associated with the
119c27c18e8Smrg          property type or AnyPropertyType.
120c27c18e8Smrg
121c27c18e8SmrgDESCRIPTION
122c27c18e8Smrg-----------
123c27c18e8Smrg
124c27c18e8SmrgThe XGetDeviceProperty function returns the actual type of the
125c27c18e8Smrgproperty; the actual format of the property; the number of
126c27c18e8Smrg8-bit, 16-bit, or 32-bit items transferred; the number of bytes
127c27c18e8Smrgremaining to be read in the property; and a pointer to the data
128c27c18e8Smrgactually returned. For a detailed description of this function,
129c27c18e8Smrgsee the man page to XGetWindowProperty.
130c27c18e8Smrg
131c27c18e8SmrgThe XChangeDeviceProperty function alters the property for the
132c27c18e8Smrgspecified device and causes the server to generate a
133c27c18e8SmrgXPropertyNotifyEvent event on that device. For a detailed
134c27c18e8Smrgdescription of this function, see the man page to
135c27c18e8SmrgXChangeProperty.
136c27c18e8Smrg
137c27c18e8SmrgThe XDeleteDeviceProperty function deletes the specified device
138c27c18e8Smrgproperty. Note that a client cannot delete a property created
139c27c18e8Smrgby a driver or the server. Attempting to do so will result in a
140c27c18e8SmrgBadAtom error.
141c27c18e8Smrg
142c27c18e8SmrgXGetDeviceProperty can generate a BadAtom, BadDevice error.
143c27c18e8Smrg
144c27c18e8SmrgXChangeDeviceProperty can generate a BadDevice, a BadMatch, a
145c27c18e8SmrgBadAtom, and a BadValue error.
146c27c18e8Smrg
147c27c18e8SmrgXDeleteDeviceProperty can generate a BadDevice, and a BadAtom
148c27c18e8Smrgerror.
149c27c18e8Smrg
150c27c18e8SmrgDIAGNOSIS
151c27c18e8Smrg---------
152c27c18e8Smrg
153c27c18e8Smrg   BadAtom
154c27c18e8Smrg          A value does not describe a valid named identifier or
155c27c18e8Smrg          the client attempted to remove a driver-allocated
156c27c18e8Smrg          property.
157c27c18e8Smrg
158c27c18e8Smrg   BadDevice
159c27c18e8Smrg          An invalid device was specified. The device does not
160c27c18e8Smrg          exist.
161c27c18e8Smrg
162c27c18e8SmrgSEE ALSO
163c27c18e8Smrg--------
164c27c18e8Smrg
165c27c18e8Smrg   XListDeviceProperties(libmansuffix)
166