1 | .\"***************************************************************************
|
---|
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
|
---|
60 | The \fBnewpad\fR routine creates and returns a pointer to a new pad data
|
---|
61 | structure with the given number of lines, \fInlines\fR, and columns,
|
---|
62 | \fIncols\fR.
|
---|
63 | A pad is like a window, except that it is not restricted by the
|
---|
64 | screen size, and is not necessarily associated with a particular part of the
|
---|
65 | screen.
|
---|
66 | Pads can be used when a large window is needed, and only a part of the
|
---|
67 | window will be on the screen at one time.
|
---|
68 | Automatic refreshes of pads
|
---|
69 | (e.g., from scrolling or echoing of input) do not occur.
|
---|
70 | It is not
|
---|
71 | legal to call \fBwrefresh\fR with a \fIpad\fR as an argument; the routines
|
---|
72 | \fBprefresh\fR or \fBpnoutrefresh\fR should be called instead.
|
---|
73 | Note that these
|
---|
74 | routines require additional parameters to specify the part of the pad to be
|
---|
75 | displayed and the location on the screen to be used for the display.
|
---|
76 | .PP
|
---|
77 | The \fBsubpad\fR routine creates and returns a pointer to a subwindow within a
|
---|
78 | pad with the given number of lines, \fInlines\fR, and columns, \fIncols\fR.
|
---|
79 | Unlike \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.
|
---|
81 | The window is
|
---|
82 | made in the middle of the window \fIorig\fR, so that changes made to one window
|
---|
83 | affect both windows.
|
---|
84 | During the use of this routine, it will often be
|
---|
85 | necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before
|
---|
86 | calling \fBprefresh\fR.
|
---|
87 | .PP
|
---|
88 | The \fBprefresh\fR and \fBpnoutrefresh\fR routines are analogous to
|
---|
89 | \fBwrefresh\fR and \fBwnoutrefresh\fR except that they relate to pads instead
|
---|
90 | of windows.
|
---|
91 | The additional parameters are needed to indicate what part of the
|
---|
92 | pad and screen are involved.
|
---|
93 | \fIpminrow\fR and \fIpmincol\fR specify the upper
|
---|
94 | left-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
|
---|
97 | rectangle to be displayed on the screen.
|
---|
98 | The lower right-hand corner of the
|
---|
99 | rectangle to be displayed in the pad is calculated from the screen coordinates,
|
---|
100 | since the rectangles must be the same size.
|
---|
101 | Both rectangles must be entirely
|
---|
102 | contained within their respective structures.
|
---|
103 | Negative values of
|
---|
104 | \fIpminrow\fR, \fIpmincol\fR, \fIsminrow\fR, or \fIsmincol\fR are treated as if
|
---|
105 | they were zero.
|
---|
106 | .PP
|
---|
107 | The \fBpechochar\fR routine is functionally equivalent to a call to \fBaddch\fR
|
---|
108 | followed by a call to \fBrefresh\fR, a call to \fBwaddch\fR followed by a call
|
---|
109 | to \fBwrefresh\fR, or a call to \fBwaddch\fR followed by a call to
|
---|
110 | \fBprefresh\fR.
|
---|
111 | The knowledge that only a single character is being output is
|
---|
112 | taken into consideration and, for non-control characters, a considerable
|
---|
113 | performance gain might be seen by using these routines instead of their
|
---|
114 | equivalents.
|
---|
115 | In the case of \fBpechochar\fR, the last location of the pad on
|
---|
116 | the screen is reused for the arguments to \fBprefresh\fR.
|
---|
117 | .PP
|
---|
118 | The \fBpecho_wchar\fR function is the analogous wide-character
|
---|
119 | form of \fBpechochar\fR.
|
---|
120 | It outputs one character to a pad and immediately refreshes the pad.
|
---|
121 | It does this by a call to \fBwadd_wch\fR followed by a call to \fBprefresh\fR.
|
---|
122 | .SH RETURN VALUE
|
---|
123 | Routines 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
|
---|
125 | completion.
|
---|
126 | .PP
|
---|
127 | Routines that return pointers return \fBNULL\fR on error, and set \fBerrno\fR
|
---|
128 | to \fBENOMEM\fR.
|
---|
129 | .PP
|
---|
130 | X/Open does not define any error conditions.
|
---|
131 | In this implementation
|
---|
132 | .RS
|
---|
133 | .TP 5
|
---|
134 | \fBprefresh\fP and \fBpnoutrefresh\fP
|
---|
135 | return an error
|
---|
136 | if the window pointer is null, or
|
---|
137 | if the window is not really a pad or
|
---|
138 | if the area to refresh extends off-screen or
|
---|
139 | if the minimum coordinates are greater than the maximum.
|
---|
140 | .TP 5
|
---|
141 | \fBpechochar\fP
|
---|
142 | returns an error
|
---|
143 | if the window is not really a pad, and the associated call
|
---|
144 | to \fBwechochar\fP returns an error.
|
---|
145 | .TP 5
|
---|
146 | \fBpecho_wchar\fP
|
---|
147 | returns an error
|
---|
148 | if the window is not really a pad, and the associated call
|
---|
149 | to \fBwecho_wchar\fP returns an error.
|
---|
150 | .RE
|
---|
151 | .SH NOTES
|
---|
152 | Note that \fBpechochar\fR may be a macro.
|
---|
153 | .SH PORTABILITY
|
---|
154 | The 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:
|
---|