blob: 52fe51cf35f11ff34be15ea7679880dee0062828 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2010,2015 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_pad.3x,v 1.18 2015/07/21 08:58:44 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH curs_pad 3X ""
31.na
32.hy 0
33.SH NAME
34\fBnewpad\fR,
35\fBsubpad\fR,
36\fBprefresh\fR,
37\fBpnoutrefresh\fR,
38\fBpechochar\fR,
Steve Kondikae271bc2015-11-15 02:50:53 +010039\fBpecho_wchar\fR \- create and display \fBcurses\fR pads
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053040.ad
41.hy
42.SH SYNOPSIS
43\fB#include <curses.h>\fR
44.sp
Steve Kondikae271bc2015-11-15 02:50:53 +010045\fBWINDOW *newpad(int \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053046.br
Steve Kondikae271bc2015-11-15 02:50:53 +010047\fBWINDOW *subpad(WINDOW *\fP\fIorig\fP\fB, int \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR
48 \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053049.br
Steve Kondikae271bc2015-11-15 02:50:53 +010050\fBint prefresh(WINDOW *\fP\fIpad\fP\fB, int \fP\fIpminrow\fP\fB, int \fP\fIpmincol\fP\fB,\fR
51 \fBint \fP\fIsminrow\fP\fB, int \fP\fIsmincol\fP\fB, int \fP\fIsmaxrow\fP\fB, int \fP\fIsmaxcol\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053052.br
Steve Kondikae271bc2015-11-15 02:50:53 +010053\fBint pnoutrefresh(WINDOW *\fP\fIpad\fP\fB, int \fP\fIpminrow\fP\fB, int \fP\fIpmincol\fP\fB,\fR
54 \fBint \fP\fIsminrow\fP\fB, int \fP\fIsmincol\fP\fB, int \fP\fIsmaxrow\fP\fB, int \fP\fIsmaxcol\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053055.br
Steve Kondikae271bc2015-11-15 02:50:53 +010056\fBint pechochar(WINDOW *\fP\fIpad\fP\fB, chtype \fP\fIch\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053057.br
Steve Kondikae271bc2015-11-15 02:50:53 +010058\fBint pecho_wchar(WINDOW *\fP\fIpad\fP\fB, const cchar_t *\fP\fIwch\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053059.SH DESCRIPTION
Steve Kondikae271bc2015-11-15 02:50:53 +010060.SS newpad
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053061The \fBnewpad\fR routine creates and returns a pointer to a new pad data
62structure with the given number of lines, \fInlines\fR, and columns,
63\fIncols\fR.
64A pad is like a window, except that it is not restricted by the
65screen size, and is not necessarily associated with a particular part of the
66screen.
67Pads can be used when a large window is needed, and only a part of the
68window will be on the screen at one time.
69Automatic refreshes of pads
70(e.g., from scrolling or echoing of input) do not occur.
71It is not
72legal to call \fBwrefresh\fR with a \fIpad\fR as an argument; the routines
73\fBprefresh\fR or \fBpnoutrefresh\fR should be called instead.
74Note that these
75routines require additional parameters to specify the part of the pad to be
76displayed and the location on the screen to be used for the display.
Steve Kondikae271bc2015-11-15 02:50:53 +010077.SS subpad
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053078.PP
79The \fBsubpad\fR routine creates and returns a pointer to a subwindow within a
80pad with the given number of lines, \fInlines\fR, and columns, \fIncols\fR.
81Unlike \fBsubwin\fR, which uses screen coordinates, the window is at position
82(\fIbegin\fR_\fIx\fR\fB,\fR \fIbegin\fR_\fIy\fR) on the pad.
83The window is
84made in the middle of the window \fIorig\fR, so that changes made to one window
85affect both windows.
86During the use of this routine, it will often be
87necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before
88calling \fBprefresh\fR.
Steve Kondikae271bc2015-11-15 02:50:53 +010089.SS prefresh, pnoutrefresh
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090.PP
91The \fBprefresh\fR and \fBpnoutrefresh\fR routines are analogous to
92\fBwrefresh\fR and \fBwnoutrefresh\fR except that they relate to pads instead
93of windows.
94The additional parameters are needed to indicate what part of the
95pad and screen are involved.
Steve Kondikae271bc2015-11-15 02:50:53 +010096The \fIpminrow\fR and \fIpmincol\fR parameters specify the upper
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053097left-hand corner of the rectangle to be displayed in the pad.
Steve Kondikae271bc2015-11-15 02:50:53 +010098The \fIsminrow\fR,
99\fIsmincol\fR, \fIsmaxrow\fR, and \fIsmaxcol\fR
100parameters specify the edges of the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530101rectangle to be displayed on the screen.
102The lower right-hand corner of the
103rectangle to be displayed in the pad is calculated from the screen coordinates,
104since the rectangles must be the same size.
105Both rectangles must be entirely
106contained within their respective structures.
107Negative values of
108\fIpminrow\fR, \fIpmincol\fR, \fIsminrow\fR, or \fIsmincol\fR are treated as if
109they were zero.
Steve Kondikae271bc2015-11-15 02:50:53 +0100110.SS pechochar
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530111.PP
112The \fBpechochar\fR routine is functionally equivalent to a call to \fBaddch\fR
113followed by a call to \fBrefresh\fR, a call to \fBwaddch\fR followed by a call
114to \fBwrefresh\fR, or a call to \fBwaddch\fR followed by a call to
115\fBprefresh\fR.
116The knowledge that only a single character is being output is
117taken into consideration and, for non-control characters, a considerable
118performance gain might be seen by using these routines instead of their
119equivalents.
120In the case of \fBpechochar\fR, the last location of the pad on
121the screen is reused for the arguments to \fBprefresh\fR.
Steve Kondikae271bc2015-11-15 02:50:53 +0100122.SS pecho_wchar
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530123.PP
124The \fBpecho_wchar\fR function is the analogous wide-character
125form of \fBpechochar\fR.
126It outputs one character to a pad and immediately refreshes the pad.
127It does this by a call to \fBwadd_wch\fR followed by a call to \fBprefresh\fR.
128.SH RETURN VALUE
129Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
130(SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
131completion.
132.PP
133Routines that return pointers return \fBNULL\fR on error, and set \fBerrno\fR
134to \fBENOMEM\fR.
135.PP
136X/Open does not define any error conditions.
137In this implementation
Steve Kondikae271bc2015-11-15 02:50:53 +0100138.RS 3
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530139.TP 5
140\fBprefresh\fP and \fBpnoutrefresh\fP
141return an error
142if the window pointer is null, or
143if the window is not really a pad or
144if the area to refresh extends off-screen or
145if the minimum coordinates are greater than the maximum.
146.TP 5
147\fBpechochar\fP
148returns an error
149if the window is not really a pad, and the associated call
150to \fBwechochar\fP returns an error.
151.TP 5
152\fBpecho_wchar\fP
153returns an error
154if the window is not really a pad, and the associated call
155to \fBwecho_wchar\fP returns an error.
156.RE
157.SH NOTES
158Note that \fBpechochar\fR may be a macro.
159.SH PORTABILITY
160The XSI Curses standard, Issue 4 describes these functions.
161.SH SEE ALSO
162\fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X), \fBcurs_addch\fR(3X).