Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XGetWindowA(3x) — HP-UX ANSI C A.09.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XGetWindowAttributes − obtain the current attributes of window. 

Synopsis

Status XGetWindowAttributes(display, w, window_attributes_return)
Display *display;
Window w;
XWindowAttributes *window_attributes_return;

Arguments

displaySpecifies a connection to an X server; returned from XOpenDisplay(). 

wSpecifies the window whose current attributes you want. 

window_attributes_return
Returns a filled XWindowAttributes structure, containing the current attributes for the specified window. 

Description

XGetWindowAttributes() returns the XWindowAttributes structure containing the current window attributes.  XGetWindowAttributes() returns a Status of zero on failure, or nonzero on success.  However, it will only return zero if you have defined an error handler that does not exit, using XSetErrorHandler().  The default error handler exits, and therefore XGetWindowAttributes() never gets a chance to return.  (Such error handling is relevant only if you are writing a window manager or other application that deals with windows that might have been destroyed.)  The following list briefly describes each member of the XWindowAttributes structure.  For more information, see Volume One, Chapter 4, Window Attributes. 

x, yThe current position of the upper-left pixel of the window’s border, relative to the origin of its parent. 

width, height
The current dimensions in pixels of this window, not including the border.

border_width
The current border width of the window.

depthThe number of bits per pixel in this window. 

visualThe visual structure. 

rootThe root window ID of the screen containing the window. 

classThe window class.  One of these constants: InputOutput or InputOnly. 

bit_gravityThe new position for existing contents after resize.  One of the constants ForgetGravity, StaticGravity, or CenterGravity, or one of the compass constants (NorthWestGravity, NorthGravity, etc.). 

win_gravityThe new position for this window after its parent is resized.  One of the constants CenterGravity, UnmapGravity, Static­Gravity, or one of the compass constants. 

backing_store
When to maintain contents of the window. One of these constants: NotUseful, WhenMapped, or Always. 

backing_planes
The bit planes to be preserved in a backing store.

backing_pixel
The pixel value used when restoring planes from a partial backing store.

save_underA boolean value, indicating whether saving bits under this window would be useful. 

colormapThe colormap ID being used in this window, or None. 

map_installed
A boolean value, indicating whether the colormap is currently installed.  If True, the window is being displayed in its chosen colors. 

map_stateThe window’s map state.  One of these constants: IsUnmapped, IsUnviewable, or IsViewable.  IsUnviewable indicates that the specified window is mapped but some ancestor is unmapped. 

all_event_masks
The set of events any client have selected. This member is the bitwise inclusive OR of all event masks selected on the window by all clients.

your_event_mask
The bitwise inclusive OR of all event mask symbols selected by the querying client.

do_not_propagate_mask
The bitwise inclusive OR of the event mask symbols that specify the set of events that should not propagate. This is global across all clients.

override_redirect
A boolean value, indicating whether this window will override structure control facilities. This is usually only used for temporary pop-up windows such as menus. Either True or False. 

screenA pointer to the Screen structure for the screen containing this window. 

Errors

BadDrawable
BadWindow

Structures

The XWindowAttributes structure contains:

typedef struct {
int x, y;/* location of window */
int width, height;/* width and height of window */
int border_width;/* border width of window */
int depth;/* depth of window */
Visual *visual;/* the associated visual structure */
Window root;/* root of screen containing window */
int class;/* InputOutput, InputOnly*/
int bit_gravity;/* one of bit gravity values */
int win_gravity;/* one of the window gravity values */
int backing_store;/* NotUseful, WhenMapped, Always */
unsigned long backing_planes; /* planes to be preserved if possible */
unsigned long backing_pixel;/* value to be used when restoring planes */
Bool save_under;/* boolean, should bits under be saved */
Colormap colormap;/* colormap to be associated with window */
Bool map_installed;/* boolean, is colormap currently installed*/
int map_state;/* IsUnmapped, IsUnviewable, IsViewable */
long all_event_masks;/* set of events all people have interest in*/
long your_event_mask;/* my event mask */
long do_not_propagate_mask;/* set of events that should not propagate */
Bool override_redirect;/* boolean value for override-redirect */
Screen *screen;/* pointer to correct screen */
} XWindowAttributes;

See Also

XChangeWindowAttributes(), XGetGeometry(), XSetWindowBackground(), XSetWindowBackgroundPixmap(), XSetWindowBorder(), XSetWindowBorderPixmap(). 

Copyright O’Reilly & Assoc.  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026