Table of Contents


XIChangeProperty, XIGetProperty, XIDeleteProperty - change, retrieve or delete a device's property.


#include <X11/extensions/XInput2.h>

void XIChangeProperty( Display* dpy,
                       int deviceid,
                       Atom property,
                       Atom type,
                       int format,
                       int mode,
                       unsigned char *data,
                       int num_items)

void XIDeleteProperty( Display *dpy,
                       int deviceid,
                       Atom property)

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)

       Returns the number of bytes remaining to be read in the prop-
       erty if a partial read was performed.

       Specifies the property data.

       Specifies the connection to the X server.

       Specifies a Boolean value that determines whether the property
       is to be deleted.

       The device to list the properties for.

       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

       Returns the actual format of the property.

       Specifies the length in 32-bit multiples of the data to be

       Specifies the offset in the specified property (in 32-bit
       quantities) where the data is to be retrieved.

       One of PropModeAppend, PropModePrepend or PropModeReplace.

       Number of items in data in the format specified.

       Returns the actual number of 8-bit, 16-bit, or 32-bit items
       stored in data.

       Specifies the property name.

       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.

       Returns the atom identifier that defines the actual type of
       the property.


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:


BadAlloc The server failed to allocate the requested resource or server memory.

BadAtom A value for an Atom argument does not name a defined Atom.

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 argumentcqs type is accepted. Any argument defined as a set of alternatives can generate this error.

BadDevice An invalid device was specified. The device does not exist.

BadAtom An invalid property was specified. The property does not exist.

See Also


Table of Contents