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