<?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='xsetpropman'>
<!--  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/XSeTProp.man,v 1.4 2003/04/28 22:17:57 herrb Exp $ -->

<!-- .na -->
<!-- Ds listing suppressed (not used) -->
<!-- De listing suppressed (not used) -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- IN 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 -->
<refmeta>
<refentrytitle>XSetTextProperty</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XSetTextProperty</refname>
<refname>XGetTextProperty</refname>
<refpurpose>set and read text properties</refpurpose>
</refnamediv>
<!-- body begins here -->

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

<para>void XSetTextProperty&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;,
XTextProperty *<emphasis remap='I'>text_prop</emphasis>&hairsp;, Atom <emphasis remap='I'>property</emphasis>&hairsp;);</para> 

<para>Status XGetTextProperty&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;,
XTextProperty *<emphasis remap='I'>text_prop_return</emphasis>&hairsp;, Atom <emphasis remap='I'>property</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'>property</emphasis></term>
  <listitem>
<para>Specifies the property name.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>text_prop</emphasis></term>
  <listitem>
<para>Specifies the
<emphasis remap='I'>&hairsp;XTextProperty&hairsp;</emphasis>
structure to be used.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>text_prop_return</emphasis></term>
  <listitem>
<para>Returns the
<emphasis remap='I'>&hairsp;XTextProperty&hairsp;</emphasis>
structure.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XSetTextProperty&hairsp;</emphasis>
function replaces the existing specified property for the named window 
with the data, type, format, and number of items determined 
by the value field, the encoding field, the format field, 
and the nitems field, respectively, of the specified
<emphasis remap='I'>&hairsp;XTextProperty&hairsp;</emphasis>
structure.
If the property does not already exist,
<emphasis remap='I'>&hairsp;XSetTextProperty&hairsp;</emphasis>
sets it for the specified window.</para>

<para><emphasis remap='I'>&hairsp;XSetTextProperty&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAlloc&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadAtom&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;XGetTextProperty&hairsp;</emphasis>
function reads the specified property from the window
and stores the data in the returned
<emphasis remap='I'>&hairsp;XTextProperty&hairsp;</emphasis>
structure.
It stores the data in the value field,
the type of the data in the encoding field,
the format of the data in the format field, 
and the number of items of data in the nitems field.
An extra byte containing null (which is not included in the nitems member) 
is stored at the end of the value field of text_prop_return.
The particular interpretation of the property's encoding 
and data as text is left to the calling application.
If the specified property does not exist on the window,
<emphasis remap='I'>&hairsp;XGetTextProperty&hairsp;</emphasis>
sets the value field to NULL, 
the encoding field to
<emphasis remap='I'>&hairsp;None&hairsp;</emphasis>,
the format field to zero, 
and the nitems field to zero.</para>

<para>If it was able to read and store the data in the
<emphasis remap='I'>&hairsp;XTextProperty&hairsp;</emphasis>
structure,
<emphasis remap='I'>&hairsp;XGetTextProperty&hairsp;</emphasis>
returns a nonzero status; 
otherwise, it returns a zero status.</para>

<para><emphasis remap='I'>&hairsp;XGetTextProperty&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAtom&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>
</refsect1>

<refsect1 id='properties'><title>PROPERTIES</title>
<variablelist remap='TP'>
  <varlistentry>
  <term>WM_CLIENT_MACHINE</term>
  <listitem>
<para>The string name of the machine on which the client application is running.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_COMMAND</term>
  <listitem>
<para>The command and arguments, null-separated, used to invoke the
application.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_ICON_NAME</term>
  <listitem>
<para>The name to be used in an icon.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_NAME</term>
  <listitem>
<para>The name of the application.</para>
  </listitem>
  </varlistentry>
</variablelist>
</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;BadAtom&hairsp;</emphasis></term>
  <listitem>
<para>A value for an Atom argument does not name a defined Atom.</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>XAllocClassHint(3X11),
XAllocIconSize(3X11),
XAllocSizeHints(3X11),
XAllocWMHints(3X11),
XSetCommand(3X11),
XSetTransientForHint(3X11),
XSetWMClientMachine(3X11),
XSetWMColormapWindows(3X11),
XSetWMIconName(3X11),
XSetWMName(3X11),
XSetWMProperties(3X11),
XSetWMProtocols(3X11),
XStringListToTextProperty(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

