<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xconfwinman'>
<!-- '\" t -->
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->

<!--  Permission is hereby granted, free of charge, to any person obtaining -->
<!--  a copy of this software and associated documentation files (the -->
<!--  "Software"), to deal in the Software without restriction, including -->
<!--  without limitation the rights to use, copy, modify, merge, publish, -->
<!--  distribute, sublicense, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice shall be included -->
<!--  in all copies or substantial portions of the Software. -->

<!--  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!--  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!--  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!--  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!--  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!--  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!--  OTHER DEALINGS IN THE SOFTWARE. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->
<!--   -->
<!--  $XFree86: xc/doc/man/X11/XConfWin.man,v 1.6 2003/11/23 05:40:33 dawes Exp $ -->

<!-- .na -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<!-- '\" t -->
<refmeta>
<refentrytitle>XConfigureWindow</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XConfigureWindow</refname>
<refname>XMoveWindow</refname>
<refname>XResizeWindow</refname>
<refname>XMoveResizeWindow</refname>
<refname>XSetWindowBorderWidth</refname>
<refname>XWindowChanges</refname>
<refpurpose>configure windows and window changes structure</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>int XConfigureWindow&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, unsigned <emphasis remap='I'>value_mask</emphasis>&hairsp;);</para>

<para>int XMoveWindow&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, int <emphasis remap='I'>x</emphasis>&hairsp;, <emphasis remap='I'>y</emphasis>&hairsp;);</para>

<para>int XResizeWindow&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, unsigned
<emphasis remap='I'>width</emphasis>&hairsp;, unsigned <emphasis remap='I'>height</emphasis>&hairsp;);</para>

<para>int XMoveResizeWindow&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, int
<emphasis remap='I'>x</emphasis>&hairsp;, int <emphasis remap='I'>y</emphasis>&hairsp;, unsigned <emphasis remap='I'>width</emphasis>&hairsp;, unsigned <emphasis remap='I'>height</emphasis>&hairsp;);</para> 

<para>int XSetWindowBorderWidth&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;,
unsigned <emphasis remap='I'>width</emphasis>&hairsp;);</para> 
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>display</emphasis></term>
  <listitem>
<para>Specifies the connection to the X server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>value_mask</emphasis></term>
  <listitem>
<para>Specifies which values are to be set using information in
the values structure.
This mask is the bitwise inclusive OR of the valid configure window values bits.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>values</emphasis></term>
  <listitem>
<para>Specifies the 
<emphasis remap='I'>&hairsp;XWindowChanges&hairsp;</emphasis>
structure.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>w</emphasis></term>
  <listitem>
<para>Specifies the window to be reconfigured, moved, or resized..</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>width</emphasis></term>
  <listitem>
<para>Specifies the width of the window border.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>width</emphasis></term>
<!-- .br -->
<!-- .ns -->
  <term><emphasis remap='I'>height</emphasis></term>
  <listitem>
<para>Specify the width and height, which are the interior dimensions of the window.
of the window's border or the window itself if it has no border
or define the new position of the window relative to its parent</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>x</emphasis></term>
<!-- .br -->
<!-- .ns -->
  <term><emphasis remap='I'>y</emphasis></term>
  <listitem>
<para>Specify the x and y coordinates, which define the new location of the top-left pixel.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XConfigureWindow&hairsp;</emphasis>
function uses the values specified in the
<emphasis remap='I'>&hairsp;XWindowChanges&hairsp;</emphasis>
structure to reconfigure a window's size, position, border, and stacking order.
Values not specified are taken from the existing geometry of the window.</para>

<para>If a sibling is specified without a stack_mode or if the window
is not actually a sibling,
a
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
error results. 
Note that the computations for
<emphasis remap='I'>&hairsp;BottomIf&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;TopIf&hairsp;</emphasis>,
and
<emphasis remap='I'>&hairsp;Opposite&hairsp;</emphasis>
are performed with respect to the window's final geometry (as controlled by the
other arguments passed to
<emphasis remap='I'>&hairsp;XConfigureWindow&hairsp;</emphasis>),
not its initial geometry.
Any backing store contents of the window, its
inferiors, and other newly visible windows are either discarded or
changed to reflect the current screen contents 
(depending on the implementation).</para>

<para><emphasis remap='I'>&hairsp;XConfigureWindow&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>,
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XMoveWindow&hairsp;</emphasis>
function moves the specified window to the specified x and y coordinates,
but it does not change the window's size, raise the window, or
change the mapping state of the window.
Moving a mapped window may or may not lose the window's contents 
depending on if the window is obscured by nonchildren 
and if no backing store exists.
If the contents of the window are lost, 
the X server generates
<emphasis remap='I'>&hairsp;Expose&hairsp;</emphasis>
events.
Moving a mapped window generates
<emphasis remap='I'>&hairsp;Expose&hairsp;</emphasis>
events on any formerly obscured windows.</para> 

<para>If the override-redirect flag of the window is 
<emphasis remap='I'>&hairsp;False&hairsp;</emphasis>
and some
other client has selected 
<emphasis remap='I'>&hairsp;SubstructureRedirectMask&hairsp;</emphasis>
on the parent, the X server generates a
<emphasis remap='I'>&hairsp;ConfigureRequest&hairsp;</emphasis>
event, and no further processing is
performed.  
Otherwise, the window is moved.</para>

<para><emphasis remap='I'>&hairsp;XMoveWindow&hairsp;</emphasis>
can generate a
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
error.</para>

<para>The
<emphasis remap='I'>&hairsp;XResizeWindow&hairsp;</emphasis>
function changes the inside dimensions of the specified window, not including
its borders.
This function does not change the window's upper-left coordinate or
the origin and does not restack the window.
Changing the size of a mapped window may lose its contents and generate
<emphasis remap='I'>&hairsp;Expose&hairsp;</emphasis>
events.
If a mapped window is made smaller, 
changing its size generates
<emphasis remap='I'>&hairsp;Expose&hairsp;</emphasis>
events on windows that the mapped window formerly obscured.</para>

<para>If the override-redirect flag of the window is 
<emphasis remap='I'>&hairsp;False&hairsp;</emphasis>
and some
other client has selected 
<emphasis remap='I'>&hairsp;SubstructureRedirectMask&hairsp;</emphasis>
on the parent, the X server generates a
<emphasis remap='I'>&hairsp;ConfigureRequest&hairsp;</emphasis>
event, and no further processing is performed.  
If either width or height is zero,
a
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
error results.</para>

<para><emphasis remap='I'>&hairsp;XResizeWindow&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XMoveResizeWindow&hairsp;</emphasis>
function changes the size and location of the specified window 
without raising it.
Moving and resizing a mapped window may generate an
<emphasis remap='I'>&hairsp;Expose&hairsp;</emphasis>
event on the window.
Depending on the new size and location parameters,
moving and resizing a window may generate 
<emphasis remap='I'>&hairsp;Expose&hairsp;</emphasis>
events on windows that the window formerly obscured.</para> 

<para>If the override-redirect flag of the window is 
<emphasis remap='I'>&hairsp;False&hairsp;</emphasis>
and some
other client has selected 
<emphasis remap='I'>&hairsp;SubstructureRedirectMask&hairsp;</emphasis>
on the parent, the X server generates a
<emphasis remap='I'>&hairsp;ConfigureRequest&hairsp;</emphasis>
event, and no further processing is performed.  
Otherwise, the window size and location are changed.</para>

<para><emphasis remap='I'>&hairsp;XMoveResizeWindow&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetWindowBorderWidth&hairsp;</emphasis>
function sets the specified window's border width to the specified width.</para>

<para><emphasis remap='I'>&hairsp;XSetWindowBorderWidth&hairsp;</emphasis>
can generate a
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
error.</para>
</refsect1>

<refsect1 id='structures'><title>STRUCTURES</title>
<para>The
<emphasis remap='I'>&hairsp;XWindowChanges&hairsp;</emphasis>
structure contains:</para>


<para>/&lowast; Configure window value mask bits */</para>


<informaltable pgwide='0' frame='none'>
  <tgroup cols='3' align='center'>
    <colspec colname='c1'/>
    <colspec colname='c2'/>
    <colspec colname='c3'/>
    <tbody>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN CWX</entry>
        <entry align='left'>(1&lt;&lt;0)</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN CWY</entry>
        <entry align='left'>(1&lt;&lt;1)</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN CWWidth</entry>
        <entry align='left'>(1&lt;&lt;2)</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN CWHeight</entry>
        <entry align='left'>(1&lt;&lt;3)</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN CWBorderWidth</entry>
        <entry align='left'>(1&lt;&lt;4)</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN CWSibling</entry>
        <entry align='left'>(1&lt;&lt;5)</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN CWStackMode</entry>
        <entry align='left'>(1&lt;&lt;6)</entry>
      </row>
    </tbody>
  </tgroup>
</informaltable>


<literallayout remap='.nf'>
<!-- .0D  0 -->

<!-- .ps \n(PS -->
<!-- .if \n(VS&gt;=40 .vs \n(VSu -->
<!-- .if \n(VS&lt;=39 .vs \n(VSp -->
<!-- .TA .5i 3i -->
<!-- .ta .5i 3i -->
/&lowast; Values */

typedef struct {
	int x, y;
	int width, height;
	int border_width;
	Window sibling;
	int stack_mode;
} XWindowChanges;
<!-- .ce 0  IGNORED -->
<!-- .in \n(OIu  IGNORED -->

</literallayout> <!-- .fi -->

<para>The x and y members are used to set the window's x and y coordinates,
which are relative to the parent's origin
and indicate the position of the upper-left outer corner of the window.
The width and height members are used to set the inside size of the window,
not including the border, and must be nonzero, or a
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
error results.
Attempts to configure a root window have no effect.</para>

<para>The border_width member is used to set the width of the border in pixels.
Note that setting just the border width leaves the outer-left corner of the window
in a fixed position but moves the absolute position of the window's origin.
If you attempt to set the border-width attribute of an
<emphasis remap='I'>&hairsp;InputOnly&hairsp;</emphasis>
window nonzero, a
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
error results.</para> 

<para>The sibling member is used to set the sibling window for stacking operations.
The stack_mode member is used to set how the window is to be restacked 
and can be set to
<emphasis remap='I'>&hairsp;Above&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;Below&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;TopIf&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BottomIf&hairsp;</emphasis>,
or 
<emphasis remap='I'>&hairsp;Opposite&hairsp;</emphasis>.</para>
</refsect1>

<refsect1 id='diagnostics'><title>DIAGNOSTICS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis></term>
  <listitem>
<para>An
<emphasis remap='I'>&hairsp;InputOnly&hairsp;</emphasis>
window is used as a Drawable.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis></term>
  <listitem>
<para>Some argument or pair of arguments has the correct type and range but fails
to match in some other way required by the request.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis></term>
  <listitem>
<para>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.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis></term>
  <listitem>
<para>A value for a Window argument does not name a defined Window.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>XChangeWindowAttributes(3X11),
XCreateWindow(3X11),
XDestroyWindow(3X11),
XMapWindow(3X11),
XRaiseWindow(3X11),
XUnmapWindow(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

