1 .\" $NetBSD: curses_window.3,v 1.15 2011/09/15 12:01:18 wiz Exp $
4 .\" Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
6 .\" This code is donated to the NetBSD Foundation by the Author.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. The name of the Author may not be used to endorse or promote
17 .\" products derived from this software without specific prior written
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .Dd September 15, 2011
49 .Nd curses window routines
67 .Fn dupwin "WINDOW *win"
69 .Fn derwin "WINDOW *win" "int lines" "int cols" "int y" "int x"
71 .Fn delwin "WINDOW *win"
73 .Fn mvwin "WINDOW *win" "int y" "int x"
75 .Fn mvderwin "WINDOW *win" "int y" "int x"
77 .Fn newwin "int lines" "int cols" "int begin_y" "int begin_x"
79 .Fn subwin "WINDOW *win" "int lines" "int cols" "int begin_y" "int begin_x"
81 .Fn overlay "WINDOW *source" "WINDOW *dest"
83 .Fn overwrite "WINDOW *source" "WINDOW *dest"
85 .Fn wresize "WINDOW *win" "int lines" "int cols"
87 These functions create, modify and delete windows on the current screen.
89 The contents of a window may be copied to another window by using the
91 function, a section of the destination window
99 will be overwritten with the contents of the window
101 starting at the coordinates
108 then only non-blank characters from
116 then all characters from
120 If the bounding rectangles of either the source or the destination
121 windows lay outside the maximum size of the respective windows then
122 the size of the window copied will be adjusted to be within the bounds
123 of both the source and destination windows.
127 function creates an exact duplicate of
129 and returns a pointer to it.
133 will create a subwindow of
135 in the same manner as
137 excepting that the starting column and row
140 are relative to the parent window origin.
142 A window may deleted and all resources freed by calling the
144 function with the pointer to the window to be deleted in
147 A window can be moved to a new position by calling the
154 positions are the new origin of the window on the screen.
155 If the new position would cause the any part of the window to lie outside
156 the screen, it is an error and the window is not moved.
158 A mapping of a region relative to the parent window may be created by
165 positions are relative to the origin of the parent window.
168 is not updated, the characters beginning at
171 for the area the size of
173 will be displayed at the screen offset of
175 If the given window in
177 is not a subwindow then an error will be returned.
178 If the new position would cause the any part of the window to lie outside
179 the parent window, it is an error and the mapping is not updated.
183 function creates a new window of size
191 is less than or equal to zero then the number of rows
192 for the window is set to
199 is less than or equal to zero then the number of columns
200 for the window is set to
209 excepting that the size of the subwindow is bounded by the parent
212 The subwindow shares internal data structures with the parent window
213 and will be refreshed when the parent window is refreshed.
214 The subwindow inherits the background character and attributes of the
219 function copies the contents of the source window
221 to the destination window
223 only the characters that are not the background character in the
224 source window are copied to the destination.
225 The windows need not be the same size, only the overlapping portion of both
226 windows will be copied.
229 function performs the same functions as
231 excepting that characters from the source window are copied to the
232 destination without exception.
235 resizes the specified window to the new number of lines and columns
236 given, all internal curses structures are resized.
237 Any subwindows of the specified window will also be resized if any part
238 of them falls outside the new parent window size.
239 The application must redraw the window after it has been resized.
244 can not be resized to be larger than the size of the screen.
246 Functions returning pointers will return
248 if an error is detected.
249 The functions that return an int will return one of the following
252 .Bl -tag -width ERR -compact
254 The function completed successfully.
256 An error occurred in the function.
259 .Xr curses_fileio 3 ,
265 Curses library complies with the X/Open Curses specification, part of the
266 Single Unix Specification.
268 The Curses package appeared in