]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_bkgd.3x.html
ncurses 6.1 - patch 20190623
[ncurses.git] / doc / html / man / curs_bkgd.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
4   *                                                                          *
5   * Permission is hereby granted, free of charge, to any person obtaining a  *
6   * copy of this software and associated documentation files (the            *
7   * "Software"), to deal in the Software without restriction, including      *
8   * without limitation the rights to use, copy, modify, merge, publish,      *
9   * distribute, distribute with modifications, sublicense, and/or sell       *
10   * copies of the Software, and to permit persons to whom the Software is    *
11   * furnished to do so, subject to the following conditions:                 *
12   *                                                                          *
13   * The above copyright notice and this permission notice shall be included  *
14   * in all copies or substantial portions of the Software.                   *
15   *                                                                          *
16   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23   *                                                                          *
24   * Except as contained in this notice, the name(s) of the above copyright   *
25   * holders shall not be used in advertising or otherwise to promote the     *
26   * sale, use or other dealings in this Software without prior written       *
27   * authorization.                                                           *
28   ****************************************************************************
29   * @Id: curs_bkgd.3x,v 1.28 2018/12/09 00:45:05 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>curs_bkgd 3x</TITLE>
37 <link rel="author" href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1 class="no-header">curs_bkgd 3x</H1>
42 <PRE>
43 <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>                                                    <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
44
45
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49        <STRONG>bkgdset</STRONG>,  <STRONG>wbkgdset</STRONG>,  <STRONG>bkgd</STRONG>,  <STRONG>wbkgd</STRONG>,  <STRONG>getbkgd</STRONG>  - <STRONG>curses</STRONG> window background
50        manipulation routines
51
52
53 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
54        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
55
56        <STRONG>void</STRONG> <STRONG>bkgdset(chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
57        <STRONG>void</STRONG> <STRONG>wbkgdset(WINDOW</STRONG> <STRONG>*</STRONG><EM>win,</EM> <EM>chtype</EM> <EM>ch</EM><STRONG>);</STRONG>
58        <STRONG>int</STRONG> <STRONG>bkgd(chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
59        <STRONG>int</STRONG> <STRONG>wbkgd(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
60        <STRONG>chtype</STRONG> <STRONG>getbkgd(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
61
62
63 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
64
65 </PRE><H3><a name="h3-bkgdset">bkgdset</a></H3><PRE>
66        The <STRONG>bkgdset</STRONG> and <STRONG>wbkgdset</STRONG> routines  manipulate  the  background  of  the
67        named window.  The window background is a <STRONG>chtype</STRONG> consisting of any com-
68        bination  of  attributes  (i.e.,  rendition)  and  a  character.    The
69        attribute part of the background is combined (OR'ed) with all non-blank
70        characters that are written into the  window  with  <STRONG>waddch</STRONG>.   Both  the
71        character  and  attribute parts of the background are combined with the
72        blank characters.  The background becomes a property of  the  character
73        and  moves  with  the character through any scrolling and insert/delete
74        line/character operations.
75
76        To the extent possible on a particular terminal, the attribute part  of
77        the  background  is displayed as the graphic rendition of the character
78        put on the screen.
79
80
81 </PRE><H3><a name="h3-bkgd">bkgd</a></H3><PRE>
82        The <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> functions set the background property of the current
83        or  specified  window  and  then  apply this setting to every character
84        position in that window.  According to  X/Open  Curses,  it  should  do
85        this:
86
87        <STRONG>o</STRONG>   The  rendition  of  every character on the screen is changed to the
88            new background rendition.
89
90        <STRONG>o</STRONG>   Wherever the former background character appears, it is changed  to
91            the new background character.
92
93        Neither  X/Open Curses nor the SVr4 manual pages give details about the
94        way the rendition of characters on the screen is updated when  <STRONG>bkgd</STRONG>  or
95        <STRONG>wbkgd</STRONG> is used to change the background character.
96
97        This  implementation,  like  SVr4 curses, does not store the background
98        and window attribute contributions to each cell separately.  It updates
99        the rendition by comparing the character, non-color attributes and col-
100        ors contained in the background.  For each cell in the window,  whether
101        or not it is blank:
102
103        <STRONG>o</STRONG>   The  library  first  compares  the <EM>character</EM>, and if it matches the
104            current character part of the background, it replaces that with the
105            new background character.
106
107        <STRONG>o</STRONG>   The  library  then  checks  if the cell uses color, i.e., its color
108            pair value is nonzero.  If not, it simply replaces  the  attributes
109            and color pair in the cell with those from the new background char-
110            acter.
111
112        <STRONG>o</STRONG>   If the cell uses color, and that matches the color in  the  current
113            background, the library removes attributes which may have come from
114            the current background and adds attributes from the new background.
115            It finishes by setting the cell to use the color from the new back-
116            ground.
117
118        <STRONG>o</STRONG>   If the cell uses color, and that does not match the  color  in  the
119            current   background,   the  library  updates  only  the  non-color
120            attributes, first removing those which may have come from the  cur-
121            rent  background,  and  then  adding  attributes from the new back-
122            ground.
123
124
125 </PRE><H3><a name="h3-getbkgd">getbkgd</a></H3><PRE>
126        The <STRONG>getbkgd</STRONG> function returns  the  given  window's  current  background
127        character/attribute pair.
128
129
130 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
131        These  functions are described in the XSI Curses standard, Issue 4.  It
132        specifies that <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return <STRONG>ERR</STRONG> on failure, but gives no fail-
133        ure conditions.
134
135        The  routines  <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return the integer <STRONG>OK</STRONG>, unless the library
136        has not been initialized.
137
138        In contrast, the SVr4.0 manual says <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> may return <STRONG>OK</STRONG> "or  a
139        non-negative  integer  if  <STRONG>immedok</STRONG>  is set", which refers to the return
140        value from <STRONG>wrefresh</STRONG> (used to implement the immediate repainting).   The
141        SVr4  curses  <STRONG>wrefresh</STRONG>  returns the number of characters written to the
142        screen during the refresh.  This implementation does not do that.
143
144
145 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
146        Note that <STRONG>bkgdset</STRONG> and <STRONG>bkgd</STRONG> may be macros.
147
148        X/Open Curses mentions that the character part of the  background  must
149        be  a  single-byte  value.   This  implementation, like SVr4, checks to
150        ensure that, and will reuse the old background character if  the  check
151        fails.
152
153
154 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
155        These  functions  are  described  in  the  XSI Curses standard, Issue 4
156        (X/Open Curses).
157
158
159 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
160        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
161
162
163
164                                                                  <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
165 </PRE>
166 <div class="nav">
167 <ul>
168 <li><a href="#h2-NAME">NAME</a></li>
169 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
170 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
171 <ul>
172 <li><a href="#h3-bkgdset">bkgdset</a></li>
173 <li><a href="#h3-bkgd">bkgd</a></li>
174 <li><a href="#h3-getbkgd">getbkgd</a></li>
175 </ul>
176 </li>
177 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
178 <li><a href="#h2-NOTES">NOTES</a></li>
179 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
180 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
181 </ul>
182 </div>
183 </BODY>
184 </HTML>