blob: c7222074ebeb07dbaee49ccc4f0d32494f23c73e [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
2.\" Copyright (c) 1998-2004,2005 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.14 2005/05/15 16:18:43 tom Exp $
30.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,
39\fBpecho_wchar\fR - create and display \fBcurses\fR pads
40.ad
41.hy
42.SH SYNOPSIS
43\fB#include <curses.h>\fR
44.sp
45\fBWINDOW *newpad(int nlines, int ncols);\fR
46.br
47\fBWINDOW *subpad(WINDOW *orig, int nlines, int ncols,\fR
48 \fBint begin_y, int begin_x);\fR
49.br
50\fBint prefresh(WINDOW *pad, int pminrow, int pmincol,\fR
51 \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR
52.br
53\fBint pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,\fR
54 \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR
55.br
56\fBint pechochar(WINDOW *pad, chtype ch);\fR
57.br
58\fBint pecho_wchar(WINDOW *pad, const cchar_t *wch);\fR
59.SH DESCRIPTION
60The \fBnewpad\fR routine creates and returns a pointer to a new pad data
61structure with the given number of lines, \fInlines\fR, and columns,
62\fIncols\fR.
63A pad is like a window, except that it is not restricted by the
64screen size, and is not necessarily associated with a particular part of the
65screen.
66Pads can be used when a large window is needed, and only a part of the
67window will be on the screen at one time.
68Automatic refreshes of pads
69(e.g., from scrolling or echoing of input) do not occur.
70It is not
71legal to call \fBwrefresh\fR with a \fIpad\fR as an argument; the routines
72\fBprefresh\fR or \fBpnoutrefresh\fR should be called instead.
73Note that these
74routines require additional parameters to specify the part of the pad to be
75displayed and the location on the screen to be used for the display.
76.PP
77The \fBsubpad\fR routine creates and returns a pointer to a subwindow within a
78pad with the given number of lines, \fInlines\fR, and columns, \fIncols\fR.
79Unlike \fBsubwin\fR, which uses screen coordinates, the window is at position
80(\fIbegin\fR_\fIx\fR\fB,\fR \fIbegin\fR_\fIy\fR) on the pad.
81The window is
82made in the middle of the window \fIorig\fR, so that changes made to one window
83affect both windows.
84During the use of this routine, it will often be
85necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before
86calling \fBprefresh\fR.
87.PP
88The \fBprefresh\fR and \fBpnoutrefresh\fR routines are analogous to
89\fBwrefresh\fR and \fBwnoutrefresh\fR except that they relate to pads instead
90of windows.
91The additional parameters are needed to indicate what part of the
92pad and screen are involved.
93\fIpminrow\fR and \fIpmincol\fR specify the upper
94left-hand corner of the rectangle to be displayed in the pad.
95\fIsminrow\fR,
96\fIsmincol\fR, \fIsmaxrow\fR, and \fIsmaxcol\fR specify the edges of the
97rectangle to be displayed on the screen.
98The lower right-hand corner of the
99rectangle to be displayed in the pad is calculated from the screen coordinates,
100since the rectangles must be the same size.
101Both rectangles must be entirely
102contained within their respective structures.
103Negative values of
104\fIpminrow\fR, \fIpmincol\fR, \fIsminrow\fR, or \fIsmincol\fR are treated as if
105they were zero.
106.PP
107The \fBpechochar\fR routine is functionally equivalent to a call to \fBaddch\fR
108followed by a call to \fBrefresh\fR, a call to \fBwaddch\fR followed by a call
109to \fBwrefresh\fR, or a call to \fBwaddch\fR followed by a call to
110\fBprefresh\fR.
111The knowledge that only a single character is being output is
112taken into consideration and, for non-control characters, a considerable
113performance gain might be seen by using these routines instead of their
114equivalents.
115In the case of \fBpechochar\fR, the last location of the pad on
116the screen is reused for the arguments to \fBprefresh\fR.
117.PP
118The \fBpecho_wchar\fR function is the analogous wide-character
119form of \fBpechochar\fR.
120It outputs one character to a pad and immediately refreshes the pad.
121It does this by a call to \fBwadd_wch\fR followed by a call to \fBprefresh\fR.
122.SH RETURN VALUE
123Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
124(SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
125completion.
126.PP
127Routines that return pointers return \fBNULL\fR on error, and set \fBerrno\fR
128to \fBENOMEM\fR.
129.PP
130X/Open does not define any error conditions.
131In this implementation
132.RS
133.TP 5
134\fBprefresh\fP and \fBpnoutrefresh\fP
135return an error
136if the window pointer is null, or
137if the window is not really a pad or
138if the area to refresh extends off-screen or
139if the minimum coordinates are greater than the maximum.
140.TP 5
141\fBpechochar\fP
142returns an error
143if the window is not really a pad, and the associated call
144to \fBwechochar\fP returns an error.
145.TP 5
146\fBpecho_wchar\fP
147returns an error
148if the window is not really a pad, and the associated call
149to \fBwecho_wchar\fP returns an error.
150.RE
151.SH NOTES
152Note that \fBpechochar\fR may be a macro.
153.SH PORTABILITY
154The XSI Curses standard, Issue 4 describes these functions.
155.SH SEE ALSO
156\fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X), \fBcurs_addch\fR(3X).
157.\"#
158.\"# The following sets edit modes for GNU EMACS
159.\"# Local Variables:
160.\"# mode:nroff
161.\"# fill-column:79
162.\"# End: