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