1 .\" $NetBSD: curses_window.3,v 1.12 2008/04/14 21:26:16 jdc 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
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 subwindow can be moved relative to the parent window by calling the
164 positions are relative to the origin of the parent window.
165 If the given window in
167 is not a subwindow then an error will be returned.
168 If the new position would cause the any part of the window to lie outside
169 the parent window, it is an error and the window is not moved.
173 function creates a new window of size
181 is less than or equal to zero then the number of rows
182 for the window is set to
189 is less than or equal to zero then the number of columns
190 for the window is set to
199 excepting that the size of the subwindow is bounded by the parent
202 The subwindow shares internal data structures with the parent window
203 and will be refreshed when the parent window is refreshed.
204 The subwindow inherits the background character and attributes of the
209 function copies the contents of the source window
211 to the destination window
213 only the characters that are not the background character in the
214 source window are copied to the destination.
215 The windows need not be the same size, only the overlapping portion of both
216 windows will be copied.
219 function performs the same functions as
221 excepting that characters from the source window are copied to the
222 destination without exception.
225 resizes the specified window to the new number of lines and columns
226 given, all internal curses structures are resized.
227 Any subwindows of the specified window will also be resized if any part
228 of them falls outside the new parent window size.
229 The application must redraw the window after it has been resized.
234 can not be resized to be larger than the size of the screen.
236 Functions returning pointers will return
238 if an error is detected.
239 The functions that return an int will return one of the following
242 .Bl -tag -width ERR -compact
244 The function completed successfully.
246 An error occurred in the function.
249 .Xr curses_fileio 3 ,
255 Curses library complies with the X/Open Curses specification, part of the
256 Single Unix Specification.
258 The Curses package appeared in