Explicitly specify `all' as the default target(as it used to be), so as
[dragonfly.git] / lib / libncurses / man / curs_refresh.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_refresh.3x,v 1.10 2001/11/03 18:57:12 tom Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_refresh.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_refresh 3X ""
32 .SH NAME
33 \fBdoupdate\fR,
34 \fBredrawwin\fR,
35 \fBrefresh\fR,
36 \fBwnoutrefresh\fR,
37 \fBwredrawln\fR,
38 \fBwrefresh\fR - refresh \fBcurses\fR windows and lines
39 .SH SYNOPSIS
40 \fB#include <curses.h>\fR
41
42 \fBint refresh(void);\fR
43 .br
44 \fBint wrefresh(WINDOW *win);\fR
45 .br
46 \fBint wnoutrefresh(WINDOW *win);\fR
47 .br
48 \fBint doupdate(void);\fR
49 .br
50 \fBint redrawwin(WINDOW *win);\fR
51 .br
52 \fBint wredrawln(WINDOW *win, int beg_line, int num_lines);\fR
53 .br
54 .SH DESCRIPTION
55 The \fBrefresh\fR and \fBwrefresh\fR routines (or \fBwnoutrefresh\fR and
56 \fBdoupdate\fR) must be called to get actual output to the terminal, as other
57 routines merely manipulate data structures.
58 The routine \fBwrefresh\fR copies
59 the named window to the physical terminal screen, taking into account what is
60 already there to do optimizations.
61 The \fBrefresh\fR routine is the
62 same, using \fBstdscr\fR as the default window.
63 Unless \fBleaveok\fR has been
64 enabled, the physical cursor of the terminal is left at the location of the
65 cursor for that window.
66
67 The \fBwnoutrefresh\fR and \fBdoupdate\fR routines allow multiple updates with
68 more efficiency than \fBwrefresh\fR alone.
69 In addition to all the window
70 structures, \fBcurses\fR keeps two data structures representing the terminal
71 screen: a physical screen, describing what is actually on the screen, and a
72 virtual screen, describing what the programmer wants to have on the screen.
73
74 The routine \fBwrefresh\fR works by first calling \fBwnoutrefresh\fR, which
75 copies the named window to the virtual screen, and then calling \fBdoupdate\fR,
76 which compares the virtual screen to the physical screen and does the actual
77 update.
78 If the programmer wishes to output several windows at once, a series
79 of calls to \fBwrefresh\fR results in alternating calls to \fBwnoutrefresh\fR
80 and \fBdoupdate\fR, causing several bursts of output to the screen.
81 By first
82 calling \fBwnoutrefresh\fR for each window, it is then possible to call
83 \fBdoupdate\fR once, resulting in only one burst of output, with fewer total
84 characters transmitted and less CPU time used.
85 If the \fIwin\fR argument to
86 \fBwrefresh\fR is the global variable \fBcurscr\fR, the screen is immediately
87 cleared and repainted from scratch.
88
89 The phrase "copies the named window to the virtual screen" above is ambiguous.
90 What actually happens is that all \fItouched\fR (changed) lines in the window
91 are copied to the virtual screen.
92 This affects programs that use overlapping
93 windows; it means that if two windows overlap, you can refresh them in either
94 order and the overlap region will be modified only when it is explicitly
95 changed.
96 (But see the section on \fBPORTABILITY\fR below for a warning about
97 exploiting this behavior.)
98
99 The \fBwredrawln\fR routine indicates to \fBcurses\fR that some screen lines
100 are corrupted and should be thrown away before anything is written over them.
101 It touches the indicated lines (marking them changed).
102 The routine \fBredrawwin\fR() touches the entire window.
103 .SH RETURN VALUE
104 Routines that return an integer return \fBERR\fR upon failure, and \fBOK\fR
105 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
106 completion.
107 .SH NOTES
108 Note that \fBrefresh\fR and \fBredrawwin\fR may be macros.
109 .SH PORTABILITY
110 The XSI Curses standard, Issue 4 describes these functions.
111
112 Whether \fBwnoutrefresh()\fR copies to the virtual screen the entire contents
113 of a window or just its changed portions has never been well-documented in
114 historic curses versions (including SVr4).
115 It might be unwise to rely on
116 either behavior in programs that might have to be linked with other curses
117 implementations.
118 Instead, you can do an explicit \fBtouchwin()\fR before the
119 \fBwnoutrefresh()\fR call to guarantee an entire-contents copy anywhere.
120 .SH SEE ALSO
121 \fBcurses\fR(3X), \fBcurs_outopts\fR(3X)
122 .\"#
123 .\"# The following sets edit modes for GNU EMACS
124 .\"# Local Variables:
125 .\"# mode:nroff
126 .\"# fill-column:79
127 .\"# End: