xref: /386bsd/usr/X386/man/man3/XGetWindowProperty.3x (revision a2142627)
.\\$1D \\$2 \\$1
.ps \\n(PS
.if \\n(VS>=40 .vs \\n(VSu
.if \\n(VS<=39 .vs \\n(VSp
..

0 .nr BD 0

..

.KS .TA .5i 3i

..
.KE

.. .. .KS

.D

choose appropriate monospace font
the imagen conditional, 480,
may be changed to L if LB is too
heavy for your eyes...

.. .R .. .. .. .TB

\\*(NO .R .. . \" Note End -- doug kraft 3/85

0 .. .ny0

XGetWindowProperty 3X11 "Release 5" "X Version 11" "XLIB FUNCTIONS"
NAME
XGetWindowProperty, XListProperties, XChangeProperty, XRotateWindowProperties, XDeleteProperty - obtain and change window properties
SYNTAX
$Header: XGetProperty.f,v 1.1 88/02/26 10:00:55 mento Exp $
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\^;

$Header: XListProps.f,v 1.1 88/02/26 10:01:22 mento Exp $
Atom *XListProperties\^(\^display, w\^, num_prop_return\^)

Display *display\^;

Window w\^;

int *num_prop_return\^;

$Header: XChProperty.f,v 1.1 88/02/26 09:58:33 mento Exp $
XChangeProperty\^(\^display, w\^, property\^, type\^, format\^, mode\^, data\^, nelements\^)

Display *display\^;

Window w\^;

Atom property\^, type\^;

int format\^;

int mode\^;

unsigned char *data\^;

int nelements\^;

XRotateWindowProperties\^(\^display, w, properties, num_prop, npositions\^)

Display *display\^;

Window w\^;

Atom properties\^[]\^;

int num_prop\^;

int npositions\^;

$Header: XDeleteProp.f,v 1.1 88/02/26 09:59:36 mento Exp $
XDeleteProperty\^(\^display, w\^, property\^)

Display *display\^;

Window w\^;

Atom property\^;

ARGUMENTS
$Header: act_format.a,v 1.1 88/02/26 10:04:45 mento Exp $
actual_format_return 1i
Returns the actual format of the property. $Header: actual_type.a,v 1.1 88/02/26 10:04:47 mento Exp $
actual_type_return 1i
Returns the atom identifier that defines the actual type of the property.
bytes_after_return 1i
Returns the number of bytes remaining to be read in the property if a partial read was performed. $Header: data1.a,v 1.1 88/02/26 10:06:15 mento Exp $
data 1i
Specifies the property data. $Header: delete.a,v 1.4 88/05/08 11:45:29 mento Exp $
delete 1i
Specifies a Boolean value that determines whether the property is deleted. $Header: display.a,v 1.1 88/02/26 10:26:29 mento Exp $
display 1i
Specifies the connection to the X server. $Header: format.a,v 1.2 88/05/08 11:59:58 mento Exp $
format 1i
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 .ZN XChangeProperty .
long_length 1i
Specifies the length in 32-bit multiples of the data to be retrieved.
long_offset 1i
Specifies the offset in the specified property (in 32-bit quantities) where the data is to be retrieved. $Header: prop_mode.a,v 1.2 88/04/04 11:18:11 mento Exp $
Changed name of this file to prop_mode.a on 1/13/87
mode 1i
Specifies the mode of the operation. You can pass .ZN PropModeReplace , .ZN PropModePrepend , or .ZN PropModeAppend . $Header: nelements.a,v 1.2 88/05/08 12:00:41 mento Exp $
nelements 1i
Specifies the number of elements of the specified data format.
nitems_return 1i
Returns the actual number of 8-bit, 16-bit, or 32-bit items stored in the prop_return data.
num_prop 1i
Specifies the length of the properties array.
num_prop_return 1i
Returns the length of the properties array.
npositions 1i
Specifies the rotation amount.
prop_return 1i
Returns the data in the specified format. $Header: property.a,v 1.2 88/04/05 15:19:43 mento Exp $
property 1i
Specifies the property name. $Header: properties.a,v 1.1 88/02/26 10:30:43 mento Exp $
properties 1i
Specifies the array of properties that are to be rotated. $Header: reqtype.a,v 1.3 88/05/08 11:46:32 mento Exp $
req_type 1i
Specifies the atom identifier associated with the property type or .ZN AnyPropertyType . $Header: type.a,v 1.2 88/03/29 08:07:25 mento Exp $
type 1i
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 .ZN XGetWindowProperty . $Header: w_gen.a,v 1.4 88/08/04 11:21:56 mento Exp $
w 1i
Specifies the window \*(Wi.
DESCRIPTION
$Header: XGetProperty.d,v 1.3 88/08/17 09:10:14 mento Exp $
The .ZN XGetWindowProperty 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. .ZN XGetWindowProperty sets the return arguments as follows:
\(bu 5
If the specified property does not exist for the specified window, .ZN XGetWindowProperty returns .ZN 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.
\(bu 5
If the specified property exists but its type does not match the specified type, .ZN XGetWindowProperty 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.
\(bu 5
If the specified property exists and either you assign .ZN AnyPropertyType to the req_type argument or the specified type matches the actual property type, .ZN XGetWindowProperty 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:
 N = actual length of the stored property in bytes
 (even if the format is 16 or 32)
 I = 4 * long_offset
 T = N - I
 L = MINIMUM(T, 4 * long_length)
 A = N - (I + L)
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 .ZN BadValue error results. The value of bytes_after_return is A, giving the number of trailing unread bytes in the stored property.

.ZN XGetWindowProperty always allocates one extra byte in prop_return (even if the property is zero length) and sets it to ASCII null so that simple properties consisting of characters do not have to be copied into yet another string before use. If delete is .ZN True and bytes_after_return is zero, .ZN XGetWindowProperty deletes the property from the window and generates a .ZN PropertyNotify event on the window.

The function returns .ZN Success if it executes successfully. To free the resulting data, use .ZN XFree .

.ZN XGetWindowProperty can generate .ZN BadAtom , .ZN BadValue , and .ZN BadWindow errors.

$Header: XListProps.d,v 1.4 88/05/08 11:58:22 mento Exp $
The .ZN XListProperties function returns a pointer to an array of atom properties that are defined for the specified window or returns NULL if no properties were found. To free the memory allocated by this function, use .ZN XFree .

.ZN XListProperties can generate a .ZN BadWindow error.

$Header: XChProperty.d,v 1.2 88/06/11 07:49:04 mento Exp $
The .ZN XChangeProperty function alters the property for the specified window and causes the X server to generate a .ZN PropertyNotify event on that window. .ZN XChangeProperty performs the following:

\(bu 5
If mode is .ZN PropModeReplace , .ZN XChangeProperty discards the previous property value and stores the new data.
\(bu 5
If mode is .ZN PropModePrepend or .ZN PropModeAppend , .ZN XChangeProperty 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 .ZN BadMatch error results. If the property is undefined, it is treated as defined with the correct type and format with zero-length data.

The lifetime of a property is not tied to the storing client. Properties remain until explicitly deleted, until the window is destroyed, or until the server resets. For a discussion of what happens when the connection to the X server is closed, see section 2.6. 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 .ZN BadAlloc error results.)

.ZN XChangeProperty can generate .ZN BadAlloc , .ZN BadAtom , .ZN BadMatch , .ZN BadValue , and .ZN BadWindow errors.

$Header: XRotProp.d,v 1.3 88/06/11 07:52:52 mento Exp $
The .ZN XRotateWindowProperties function allows you to rotate properties on a window and causes the X server to generate .ZN PropertyNotify events. If the property names in the properties array are viewed as being numbered starting from zero and if there are num_prop property names in the list, then the value associated with property name I becomes the value associated with property name (I + npositions) mod N for all I from zero to N - 1. The effect is to rotate the states by npositions places around the virtual ring of property names (right for positive npositions, left for negative npositions). If npositions mod N is nonzero, the X server generates a .ZN PropertyNotify event for each property in the order that they are listed in the array. If an atom occurs more than once in the list or no property with that name is defined for the window, a .ZN BadMatch error results. If a .ZN BadAtom or .ZN BadMatch error results, no properties are changed.

.ZN XRotateWindowProperties can generate .ZN BadAtom , .ZN BadMatch , and .ZN BadWindow errors.

$Header: XDeleteProp.d,v 1.2 88/05/08 12:07:50 mento Exp $
The .ZN XDeleteProperty function deletes the specified property only if the property was defined on the specified window and causes the X server to generate a .ZN PropertyNotify event on the window unless the property does not exist.

.ZN XDeleteProperty can generate .ZN BadAtom and .ZN BadWindow errors.

DIAGNOSTICS
$Header: badalloc.e,v 1.3 87/09/11 11:17:14 mento Exp $

1i .ZN BadAlloc The server failed to allocate the requested resource or server memory. $Header: badatom.e,v 1.1 87/09/04 08:22:55 mento Exp $

1i .ZN BadAtom A value for an Atom argument does not name a defined Atom. $Header: badvalue.e,v 1.1 87/09/04 08:23:19 mento Exp $

1i .ZN 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. $Header: badwindow.e,v 1.1 87/09/04 08:23:20 mento Exp $

1i .ZN BadWindow A value for a Window argument does not name a defined Window.

"SEE ALSO"
XFree(3X11), XInternAtom(3X11)

\*(xL