int XGetWindowProperty(display, w, property, long_offset, long_length, delete, req_type,
actual_type_return, actual_format_return, nitems_return, bytes_after_return,
prop_return)
Display *display;
Window w;
Atom property;
long long_offset, long_length;
Bool delete;
Atom req_type;
Atom *actual_type_return;
int *actual_format_return;
unsigned long *nitems_return;
unsigned long *bytes_after_return;
unsigned char **prop_return;
display | Specifies the connection to the X server. |
w | Specifies the window whose property you want to obtain. |
property | Specifies the property name. |
long_offset | Specifies the offset in the specified property (in 32-bit quantities) where the data is to be retrieved. |
long_length | Specifies the length in 32-bit multiples of the data to be retrieved. |
delete | Specifies a Boolean value that determines whether the property is deleted. |
req_type | Specifies the atom identifier associated with the property type or AnyPropertyType. |
actual_type_return | Returns the atom identifier that defines the actual type of the property. |
actual_format_return | Returns the actual format of the property. |
nitems_return | Returns the actual number of 8-bit, 16-bit, or 32-bit items stored in the prop_return data. |
bytes_after_return | Returns the number of bytes remaining to be read in the property if a partial read was performed. |
prop_return | Returns the data in the specified format. |
N = actual length of the stored property in bytes (even if the format is 16 or 32)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.
I = 4 * long_offset
T = N - I
L = MINIMUM(T, 4 * long_length)
A = N - (I + L)
XGetWindowProperty() 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.
If delete is True and bytes_after_return is zero, XGetWindowProperty() deletes the property from the window and generates a PropertyNotify event on the window.
The function returns Success if it executes successfully. To free the resulting data, use XFree().
XGetWindowProperty() can generate BadAtom, BadValue , and BadWindow errors.
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 argument's type is accepted. Any argument defined as a set of alternatives can generate this error. |
BadWindow | A value for a Window argument does not name a defined Window. |