Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / curs_pad.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2003,2004 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_pad.3x,v 1.12 2004/01/04 01:36:49 tom Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_pad.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_pad 3X ""
32 .SH NAME
33 \fBnewpad\fR, \fBsubpad\fR, \fBprefresh\fR,
34 \fBpnoutrefresh\fR,
35 \fBpechochar\fR, \fBpecho_wchar\fR - create and display \fBcurses\fR pads
36 .SH SYNOPSIS
37 \fB#include <curses.h>\fR
38 .sp
39 \fBWINDOW *newpad(int nlines, int ncols);\fR
40 .br
41 \fBWINDOW *subpad(WINDOW *orig, int nlines, int ncols,\fR
42       \fBint begin_y, int begin_x);\fR
43 .br
44 \fBint prefresh(WINDOW *pad, int pminrow, int pmincol,\fR
45       \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR
46 .br
47 \fBint pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,\fR
48       \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR
49 .br
50 \fBint pechochar(WINDOW *pad, chtype ch);\fR
51 .br
52 \fBint pecho_wchar(WINDOW *pad, const cchar_t *wch);\fR
53 .SH DESCRIPTION
54 The \fBnewpad\fR routine creates and returns a pointer to a new pad data
55 structure with the given number of lines, \fInlines\fR, and columns,
56 \fIncols\fR.
57 A pad is like a window, except that it is not restricted by the
58 screen size, and is not necessarily associated with a particular part of the
59 screen.
60 Pads can be used when a large window is needed, and only a part of the
61 window will be on the screen at one time.
62 Automatic refreshes of pads
63 (e.g., from scrolling or echoing of input) do not occur.
64 It is not
65 legal to call \fBwrefresh\fR with a \fIpad\fR as an argument; the routines
66 \fBprefresh\fR or \fBpnoutrefresh\fR should be called instead.
67 Note that these
68 routines require additional parameters to specify the part of the pad to be
69 displayed and the location on the screen to be used for the display.
70 .PP
71 The \fBsubpad\fR routine creates and returns a pointer to a subwindow within a
72 pad with the given number of lines, \fInlines\fR, and columns, \fIncols\fR.
73 Unlike \fBsubwin\fR, which uses screen coordinates, the window is at position
74 (\fIbegin\fR_\fIx\fR\fB,\fR \fIbegin\fR_\fIy\fR) on the pad.
75 The window is
76 made in the middle of the window \fIorig\fR, so that changes made to one window
77 affect both windows.
78 During the use of this routine, it will often be
79 necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before
80 calling \fBprefresh\fR.
81 .PP
82 The \fBprefresh\fR and \fBpnoutrefresh\fR routines are analogous to
83 \fBwrefresh\fR and \fBwnoutrefresh\fR except that they relate to pads instead
84 of windows.
85 The additional parameters are needed to indicate what part of the
86 pad and screen are involved.
87 \fIpminrow\fR and \fIpmincol\fR specify the upper
88 left-hand corner of the rectangle to be displayed in the pad.
89 \fIsminrow\fR,
90 \fIsmincol\fR, \fIsmaxrow\fR, and \fIsmaxcol\fR specify the edges of the
91 rectangle to be displayed on the screen.
92 The lower right-hand corner of the
93 rectangle to be displayed in the pad is calculated from the screen coordinates,
94 since the rectangles must be the same size.
95 Both rectangles must be entirely
96 contained within their respective structures.
97 Negative values of
98 \fIpminrow\fR, \fIpmincol\fR, \fIsminrow\fR, or \fIsmincol\fR are treated as if
99 they were zero.
100 .PP
101 The \fBpechochar\fR routine is functionally equivalent to a call to \fBaddch\fR
102 followed by a call to \fBrefresh\fR, a call to \fBwaddch\fR followed by a call
103 to \fBwrefresh\fR, or a call to \fBwaddch\fR followed by a call to
104 \fBprefresh\fR.
105 The knowledge that only a single character is being output is
106 taken into consideration and, for non-control characters, a considerable
107 performance gain might be seen by using these routines instead of their
108 equivalents.
109 In the case of \fBpechochar\fR, the last location of the pad on
110 the screen is reused for the arguments to \fBprefresh\fR.
111 .PP
112 The \fBpecho_wchar\fR function is the analogous wide-character
113 form of \fBpechochar\fR.
114 It outputs one character to a pad and immediately refreshes the pad.
115 It does this by a call to \fBwadd_wch\fR followed by a call to \fBprefresh\fR.
116 .SH RETURN VALUE
117 Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
118 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
119 completion.
120 .PP
121 Routines that return pointers return \fBNULL\fR on error, and set \fBerrno\fR
122 to \fBENOMEM\fR.
123 .SH NOTES
124 Note that \fBpechochar\fR may be a macro.
125 .SH PORTABILITY
126 The XSI Curses standard, Issue 4 describes these functions.
127 .SH SEE ALSO
128 \fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X), \fBcurs_addch\fR(3X).
129 .\"#
130 .\"# The following sets edit modes for GNU EMACS
131 .\"# Local Variables:
132 .\"# mode:nroff
133 .\"# fill-column:79
134 .\"# End: