1 .\" $NetBSD: curses_window.3,v 1.16 2013/10/15 22:15:17 roy 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
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
150 then no action occurs.
152 A window can be moved to a new position by calling the
159 positions are the new origin of the window on the screen.
160 If the new position would cause the any part of the window to lie outside
161 the screen, it is an error and the window is not moved.
163 A mapping of a region relative to the parent window may be created by
170 positions are relative to the origin of the parent window.
173 is not updated, the characters beginning at
176 for the area the size of
178 will be displayed at the screen offset of
180 If the given window in
182 is not a subwindow then an error will be returned.
183 If the new position would cause the any part of the window to lie outside
184 the parent window, it is an error and the mapping is not updated.
188 function creates a new window of size
196 is less than or equal to zero then the number of rows
197 for the window is set to
204 is less than or equal to zero then the number of columns
205 for the window is set to
214 excepting that the size of the subwindow is bounded by the parent
217 The subwindow shares internal data structures with the parent window
218 and will be refreshed when the parent window is refreshed.
219 The subwindow inherits the background character and attributes of the
224 function copies the contents of the source window
226 to the destination window
228 only the characters that are not the background character in the
229 source window are copied to the destination.
230 The windows need not be the same size, only the overlapping portion of both
231 windows will be copied.
234 function performs the same functions as
236 excepting that characters from the source window are copied to the
237 destination without exception.
240 resizes the specified window to the new number of lines and columns
241 given, all internal curses structures are resized.
242 Any subwindows of the specified window will also be resized if any part
243 of them falls outside the new parent window size.
244 The application must redraw the window after it has been resized.
249 can not be resized to be larger than the size of the screen.
251 Functions returning pointers will return
253 if an error is detected.
254 The functions that return an int will return one of the following
257 .Bl -tag -width ERR -compact
259 The function completed successfully.
261 An error occurred in the function.
264 .Xr curses_fileio 3 ,
270 Curses library complies with the X/Open Curses specification, part of the
271 Single Unix Specification.
273 The Curses package appeared in