<?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='xawmhintsman'>
<!-- '\" 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/XAWMHints.man,v 1.5 2003/11/23 05:40:33 dawes Exp $ -->

1991. 
<!-- .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>XAllocWMHints</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XAllocWMHints</refname>
<refname>XSetWMHints</refname>
<refname>XGetWMHints</refname>
<refname>XWMHints</refname>
<refpurpose>allocate window manager hints structure and set or read a window's WM_HINTS property</refpurpose>
</refnamediv>
<!-- body begins here -->

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

<para>XWMHints *XAllocWMHints&hairsp;(void&hairsp;);</para> 

<para>int XSetWMHints&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, Window <emphasis remap='I'>w</emphasis>, XWMHints *<emphasis remap='I'>wmhints</emphasis>&hairsp;);</para>

<para>XWMHints *XGetWMHints&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, Window <emphasis remap='I'>w</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'>w</emphasis></term>
  <listitem>
<para>Specifies the window.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>wmhints</emphasis></term>
  <listitem>
<para>Specifies the 
<emphasis remap='I'>&hairsp;XWMHints&hairsp;</emphasis>
structure to be used.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XAllocWMHints&hairsp;</emphasis>
function allocates and returns a pointer to a
<emphasis remap='I'>&hairsp;XWMHints&hairsp;</emphasis>
structure.
Note that all fields in the
<emphasis remap='I'>&hairsp;XWMHints&hairsp;</emphasis>
structure are initially set to zero.
If insufficient memory is available, 
<emphasis remap='I'>&hairsp;XAllocWMHints&hairsp;</emphasis>
returns NULL.
To free the memory allocated to this structure,
use
<emphasis remap='I'>&hairsp;XFree&hairsp;</emphasis>.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetWMHints&hairsp;</emphasis>
function sets the window manager hints that include icon information and location,
the initial state of the window, and whether the application relies on the
window manager to get keyboard input.</para>

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

<para>The
<emphasis remap='I'>&hairsp;XGetWMHints&hairsp;</emphasis>
function reads the window manager hints and 
returns NULL if no WM_HINTS property was set on the window 
or returns a pointer to a 
<emphasis remap='I'>&hairsp;XWMHints&hairsp;</emphasis>
structure if it succeeds.
When finished with the data,
free the space used for it by calling
<emphasis remap='I'>&hairsp;XFree&hairsp;</emphasis>.</para>

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

<refsect1 id='properties'><title>PROPERTIES</title>
<variablelist remap='TP'>
  <varlistentry>
  <term>WM_HINTS</term>
  <listitem>
<para>Additional hints set by the client for use by the window manager.
The C type of this property is 
<emphasis remap='I'>&hairsp;XWMHints&hairsp;</emphasis>.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

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

<para>/&lowast; Window manager hints 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 InputHint</entry>
        <entry align='left'>(1L &lt;&lt; 0);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN StateHint</entry>
        <entry align='left'>(1L &lt;&lt; 1);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN IconPixmapHint</entry>
        <entry align='left'>(1L &lt;&lt; 2);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN IconWindowHint</entry>
        <entry align='left'>(1L &lt;&lt; 3);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN IconPositionHint</entry>
        <entry align='left'>(1L &lt;&lt; 4);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN IconMaskHint</entry>
        <entry align='left'>(1L &lt;&lt; 5);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN WindowGroupHint</entry>
        <entry align='left'>(1L &lt;&lt; 6);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN UrgencyHint</entry>
        <entry align='left'>(1L &lt;&lt; 8);</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN AllHints</entry>
        <entry align='left'>(InputHint|StateHint|IconPixmapHint|
.br
IconWindowHint|IconPositionHint|
.br
IconMaskHint|WindowGroupHint);</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 2.5i -->
<!-- .ta .5i 2.5i -->
/&lowast; Values */

typedef struct {
	long flags;	/&lowast; marks which fields in this structure are defined */
	Bool input;	/&lowast; does this application rely on the window manager to
			get keyboard input? */
	int initial_state;	/&lowast; see below */
	Pixmap icon_pixmap;	/&lowast; pixmap to be used as icon */
	Window icon_window;	/&lowast; window to be used as icon */
	int icon_x, icon_y;	/&lowast; initial position of icon */
	Pixmap icon_mask;	/&lowast; pixmap to be used as mask for icon_pixmap */
	XID window_group;	/&lowast; id of related window group */
	/&lowast; this structure may be extended in the future */
} XWMHints;
<!-- .ce 0  IGNORED -->
<!-- .in \n(OIu  IGNORED -->

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

<para>The input member is used to communicate to the window manager the input focus
model used by the application.
Applications that expect input but never explicitly set focus to any 
of their subwindows (that is, use the push model of focus management), 
such as X Version 10 style applications that use real-estate
driven focus, should set this member to 
<emphasis remap='I'>&hairsp;True&hairsp;</emphasis>.
Similarly, applications
that set input focus to their subwindows only when it is given to their
top-level window by a window manager should also set this member to 
<emphasis remap='I'>&hairsp;True&hairsp;</emphasis>.
Applications that manage their own input focus by explicitly setting
focus to one of their subwindows whenever they want keyboard input 
(that is, use the pull model of focus management) should set this member to 
<emphasis remap='I'>&hairsp;False&hairsp;</emphasis>.
Applications that never expect any keyboard input also should set this member
to 
<emphasis remap='I'>&hairsp;False&hairsp;</emphasis>.</para>

<para>Pull model window managers should make it possible for push model
applications to get input by setting input focus to the top-level windows of
applications whose input member is 
<emphasis remap='I'>&hairsp;True&hairsp;</emphasis>.
Push model window managers should
make sure that pull model applications do not break them 
by resetting input focus to 
<emphasis remap='I'>&hairsp;PointerRoot&hairsp;</emphasis>
when it is appropriate (for example, whenever an application whose
input member is 
<emphasis remap='I'>&hairsp;False&hairsp;</emphasis>
sets input focus to one of its subwindows).</para>

<para>The definitions for the initial_state flag are:</para>


<informaltable pgwide='0' frame='none'>
  <tgroup cols='4' align='center'>
    <colspec colname='c1'/>
    <colspec colname='c2'/>
    <colspec colname='c3'/>
    <colspec colname='c4'/>
    <tbody>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN WithdrawnState</entry>
        <entry align='left'>0</entry>
        <entry align='left'>T}</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN NormalState</entry>
        <entry align='left'>1</entry>
        <entry align='left'>/&lowast; most applications start this way */</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN IconicState</entry>
        <entry align='left'>3</entry>
        <entry align='left'>/&lowast; application wants to start as an icon */</entry>
      </row>
    </tbody>
  </tgroup>
</informaltable>


<para>The icon_mask specifies which pixels of the icon_pixmap should be used as the
icon.  
This allows for nonrectangular icons.
Both icon_pixmap and icon_mask must be bitmaps.
The icon_window lets an application provide a window for use as an icon
for window managers that support such use.
The window_group lets you specify that this window belongs to a group
of other windows.
For example, if a single application manipulates multiple 
top-level windows, this allows you to provide enough
information that a window manager can iconify all of the windows
rather than just the one window.</para>

<para>The
<emphasis remap='I'>&hairsp;UrgencyHint&hairsp;</emphasis>
flag, if set in the flags field, indicates that the client deems the window
contents to be urgent, requiring the timely response of the user.  The
window manager will make some effort to draw the user's attention to this
window while this flag is set.  The client must provide some means by which the
user can cause the urgency flag to be cleared (either mitigating
the condition that made the window urgent or merely shutting off the alarm);
or the window to be withdrawn.</para>
</refsect1>

<refsect1 id='diagnostics'><title>DIAGNOSTICS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadAlloc&hairsp;</emphasis></term>
  <listitem>
<para>The server failed to allocate the requested resource or server memory.</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>XAllocClassHint(3X11),
XAllocIconSize(3X11),
XAllocSizeHints(3X11),
XFree(3X11),
XSetCommand(3X11),
XSetTransientForHint(3X11),
XSetTextProperty(3X11),
XSetWMClientMachine(3X11),
XSetWMColormapWindows(3X11),
XSetWMIconName(3X11),
XSetWMName(3X11),
XSetWMProperties(3X11),
XSetWMProtocols(3X11),
XStringListToTextProperty(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface, </userinput>O'Reilly and Associates, Sebastopol,<emphasis remap='P->I'></emphasis></para>
</refsect1>
</refentry>

