


XGetWindowAttributes(3X11)			   XGetWindowAttributes(3X11)
X11R5									X11R5



NAME
  XGetWindowAttributes,	XGetGeometry, XWindowAttributes	- get current window
  attribute or geometry	and current window attributes structure

SYNTAX
  Status XGetWindowAttributes(_d_i_s_p_l_a_y, _w, _w_i_n_d_o_w__a_t_t_r_i_b_u_t_e_s__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	Window _w;
	XWindowAttributes *_w_i_n_d_o_w__a_t_t_r_i_b_u_t_e_s__r_e_t_u_r_n;

  Status XGetGeometry(_d_i_s_p_l_a_y, _d, _r_o_o_t__r_e_t_u_r_n, _x__r_e_t_u_r_n, _y__r_e_t_u_r_n,
  _w_i_d_t_h__r_e_t_u_r_n,
			_h_e_i_g_h_t__r_e_t_u_r_n, _b_o_r_d_e_r__w_i_d_t_h__r_e_t_u_r_n, _d_e_p_t_h__r_e_t_u_r_n)
	  Display *_d_i_s_p_l_a_y;
	  Drawable _d;
	  Window *_r_o_o_t__r_e_t_u_r_n;
	  int *_x__r_e_t_u_r_n, *_y__r_e_t_u_r_n;
	  unsigned int *_w_i_d_t_h__r_e_t_u_r_n, *_h_e_i_g_h_t__r_e_t_u_r_n;
	  unsigned int *_b_o_r_d_e_r__w_i_d_t_h__r_e_t_u_r_n;
	  unsigned int *_d_e_p_t_h__r_e_t_u_r_n;

ARGUMENTS

  _b_o_r_d_e_r__w_i_d_t_h__r_e_t_u_r_n
	    Returns the	border width in	pixels.

  _d	    Specifies the drawable, which can be a window or a pixmap.

  _d_e_p_t_h__r_e_t_u_r_n
	    Returns the	depth of the drawable (bits per	pixel for the
	    object).

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _r_o_o_t__r_e_t_u_r_n
	    Returns the	root window.

  _w	    Specifies the window whose current attributes you want to obtain.

  _w_i_d_t_h__r_e_t_u_r_n
  _h_e_i_g_h_t__r_e_t_u_r_n
	    Return the drawable's dimensions (width and	height).

  _w_i_n_d_o_w__a_t_t_r_i_b_u_t_e_s__r_e_t_u_r_n
	    Returns the	specified window's attributes in the _X_W_i_n_d_o_w_A_t_t_r_i_-
	    _b_u_t_e_s structure.

  _x__r_e_t_u_r_n
  _y__r_e_t_u_r_n  Return the x and y coordinates that	define the location of the
	    drawable.  For a window, these coordinates specify the upper-left
	    outer corner relative to its parent's origin.  For pixmaps,	these
	    coordinates	are always zero.

DESCRIPTION
  The _X_G_e_t_W_i_n_d_o_w_A_t_t_r_i_b_u_t_e_s function returns the	current	attributes for the
  specified window to an _X_W_i_n_d_o_w_A_t_t_r_i_b_u_t_e_s structure.


  _X_G_e_t_W_i_n_d_o_w_A_t_t_r_i_b_u_t_e_s can generate _B_a_d_D_r_a_w_a_b_l_e	and _B_a_d_W_i_n_d_o_w errors.

  The _X_G_e_t_G_e_o_m_e_t_r_y function returns the	root window and	the current geometry
  of the drawable.  The	geometry of the	drawable includes the x	and y coordi-
  nates, width and height, border width, and depth.  These are described in
  the argument list.  It is legal to pass to this function a window whose
  class	is _I_n_p_u_t_O_n_l_y.

STRUCTURES
  The _X_W_i_n_d_o_w_A_t_t_r_i_b_u_t_e_s	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 the	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;	  /* color map to be associated	with window */
	  Bool map_installed;	  /* boolean, is color map 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; /* back pointer to correct screen */
  } XWindowAttributes;

  The x	and y members are set to the upper-left	outer corner relative to the
  parent window's origin.  The width and height	members	are set	to the inside
  size of the window, not including the	border.	 The border_width member is
  set to the window's border width in pixels.  The depth member	is set to the
  depth	of the window (that is,	bits per pixel for the object).	 The visual
  member is a pointer to the screen's associated _V_i_s_u_a_l	structure.  The	root
  member is set	to the root window of the screen containing the	window.	 The
  class	member is set to the window's class and	can be either _I_n_p_u_t_O_u_t_p_u_t or
  _I_n_p_u_t_O_n_l_y.

  The bit_gravity member is set	to the window's	bit gravity and	can be one of
  the following:

  tab(); l l.  T{ _F_o_r_g_e_t_G_r_a_v_i_t_y	T}T{ _E_a_s_t_G_r_a_v_i_t_y T} T{ _N_o_r_t_h_W_e_s_t_G_r_a_v_i_t_y	T}T{
  _S_o_u_t_h_W_e_s_t_G_r_a_v_i_t_y T} T{ _N_o_r_t_h_G_r_a_v_i_t_y T}T{ _S_o_u_t_h_G_r_a_v_i_t_y	T} T{ _N_o_r_t_h_E_a_s_t_G_r_a_v_-
  _i_t_y T}T{ _S_o_u_t_h_E_a_s_t_G_r_a_v_i_t_y T} T{ _W_e_s_t_G_r_a_v_i_t_y T}T{ _S_t_a_t_i_c_G_r_a_v_i_t_y T} _C_e_n_t_e_r_-
  _G_r_a_v_i_t_y

  The win_gravity member is set	to the window's	window gravity and can be one
  of the following:

  tab(); l l.  T{ _U_n_m_a_p_G_r_a_v_i_t_y T}T{ _E_a_s_t_G_r_a_v_i_t_y	T} T{ _N_o_r_t_h_W_e_s_t_G_r_a_v_i_t_y T}T{
  _S_o_u_t_h_W_e_s_t_G_r_a_v_i_t_y T} T{ _N_o_r_t_h_G_r_a_v_i_t_y T}T{ _S_o_u_t_h_G_r_a_v_i_t_y	T} T{ _N_o_r_t_h_E_a_s_t_G_r_a_v_-
  _i_t_y T}T{ _S_o_u_t_h_E_a_s_t_G_r_a_v_i_t_y T} T{ _W_e_s_t_G_r_a_v_i_t_y T}T{ _S_t_a_t_i_c_G_r_a_v_i_t_y T} _C_e_n_t_e_r_-
  _G_r_a_v_i_t_y

  For additional information on	gravity, see section 3.3.

  The backing_store member is set to indicate how the X	server should main-
  tain the contents of a window	and can	be _W_h_e_n_M_a_p_p_e_d, _A_l_w_a_y_s, or _N_o_t_U_s_e_f_u_l.
  The backing_planes member is set to indicate (with bits set to 1) which bit
  planes of the	window hold dynamic data that must be preserved	in
  backing_stores and during save_unders.  The backing_pixel member is set to
  indicate what	values to use for planes not set in backing_planes.

  The save_under member	is set to _T_r_u_e or _F_a_l_s_e.  The colormap member is set
  to the colormap for the specified window and can be a	colormap ID or _N_o_n_e.
  The map_installed member is set to indicate whether the colormap is
  currently installed and can be _T_r_u_e or _F_a_l_s_e.	 The map_state member is set
  to indicate the state	of the window and can be _I_s_U_n_m_a_p_p_e_d, _I_s_U_n_v_i_e_w_a_b_l_e, or
  _I_s_V_i_e_w_a_b_l_e.  _I_s_U_n_v_i_e_w_a_b_l_e is used if the window is mapped but	some ancestor
  is unmapped.

  The all_event_masks member is	set to the bitwise inclusive OR	of all event
  masks	selected on the	window by all clients.	The your_event_mask member is
  set to the bitwise inclusive OR of all event masks selected by the querying
  client.  The do_not_propagate_mask member is set to the bitwise inclusive
  OR of	the set	of events that should not propagate.

  The override_redirect	member is set to indicate whether this window over-
  rides	structure control facilities and can be	_T_r_u_e or	_F_a_l_s_e.	Window
  manager clients should ignore	the window if this member is _T_r_u_e.

  The screen member is set to a	screen pointer that gives you a	back pointer
  to the correct screen.  This makes it	easier to obtain the screen informa-
  tion without having to loop over the root window fields to see which field
  matches.

DIAGNOSTICS

  _B_a_d_D_r_a_w_a_b_l_e
	    A value for	a Drawable argument does not name a defined Window or
	    Pixmap.

  _B_a_d_W_i_n_d_o_w A value for	a Window argument does not name	a defined Window.

SEE ALSO
  XQueryPointer(3X11), XQueryTree(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e	delim off




























