Explicitly specify `all' as the default target(as it used to be), so as
[dragonfly.git] / lib / libncurses / man / curs_window.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2000,2003 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_window.3x,v 1.10 2003/05/10 20:33:49 jmc Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_window.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_window 3X ""
32 .SH NAME
33 \fBnewwin\fR,
34 \fBdelwin\fR,
35 \fBmvwin\fR,
36 \fBsubwin\fR,
37 \fBderwin\fR,
38 \fBmvderwin\fR,
39 \fBdupwin\fR,
40 \fBwsyncup\fR,
41 \fBsyncok\fR,
42 \fBwcursyncup\fR,
43 \fBwsyncdown\fR - create \fBcurses\fR windows
44 .SH SYNOPSIS
45 \fB#include <curses.h>\fR
46
47 \fBWINDOW *newwin(int nlines, int ncols, int begin_y,\fR
48       \fBint begin_x);\fR
49 .br
50 \fBint delwin(WINDOW *win);\fR
51 .br
52 \fBint mvwin(WINDOW *win, int y, int x);\fR
53 .br
54 \fBWINDOW *subwin(WINDOW *orig, int nlines, int ncols,\fR
55       \fBint begin_y, int begin_x);\fR
56 .br
57 \fBWINDOW *derwin(WINDOW *orig, int nlines, int ncols,\fR
58       \fBint begin_y, int begin_x);\fR
59 .br
60 \fBint mvderwin(WINDOW *win, int par_y, int par_x);\fR
61 .br
62 \fBWINDOW *dupwin(WINDOW *win);\fR
63 .br
64 \fBvoid wsyncup(WINDOW *win);\fR
65 .br
66 \fBint syncok(WINDOW *win, bool bf);\fR
67 .br
68 \fBvoid wcursyncup(WINDOW *win);\fR
69 .br
70 \fBvoid wsyncdown(WINDOW *win);\fR
71 .br
72 .SH DESCRIPTION
73 Calling \fBnewwin\fR creates and returns a pointer to a new window with the
74 given number of lines and columns.  The upper left-hand corner of the window is
75 at line \fIbegin\fR_\fIy\fR, column \fIbegin\fR_\fIx\fR.  If either
76 \fInlines\fR or \fIncols\fR is zero, they default to \fBLINES -\fR
77 \fIbegin\fR_\fIy\fR and \fBCOLS -\fR \fIbegin\fR_\fIx\fR.  A new full-screen
78 window is created by calling \fBnewwin(0,0,0,0)\fR.
79
80 Calling \fBdelwin\fR deletes the named window, freeing all memory
81 associated with it (it does not actually erase the window's screen
82 image).  Subwindows must be deleted before the main window can be
83 deleted.
84
85 Calling \fBmvwin\fR moves the window so that the upper left-hand
86 corner is at position (\fIx\fR, \fIy\fR).  If the move would cause the
87 window to be off the screen, it is an error and the window is not
88 moved.  Moving subwindows is allowed, but should be avoided.
89
90 Calling \fBsubwin\fR creates and returns a pointer to a new window
91 with the given number of lines, \fInlines\fR, and columns,
92 \fIncols\fR.  The window is at position (\fIbegin\fR_\fIy\fR,
93 \fIbegin\fR_\fIx\fR) on the screen.  (This position is relative to the
94 screen, and not to the window \fIorig\fR.)  The window is made in the
95 middle of the window \fIorig\fR, so that changes made to one window
96 will affect both windows.  The subwindow shares memory with the window
97 \fIorig\fR.  When using this routine, it is necessary to call
98 \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before calling
99 \fBwrefresh\fR on the subwindow.
100
101 Calling \fBderwin\fR is the same as calling \fBsubwin,\fR except that
102 \fIbegin\fR_\fIy\fR and \fIbegin\fR_\fIx\fR are relative to the origin
103 of the window \fIorig\fR rather than the screen.  There is no
104 difference between the subwindows and the derived windows.
105
106 Calling \fBmvderwin\fR moves a derived window (or subwindow)
107 inside its parent window.  The screen-relative parameters of the
108 window are not changed.  This routine is used to display different
109 parts of the parent window at the same physical position on the
110 screen.
111
112 Calling \fBdupwin\fR creates an exact duplicate of the window \fIwin\fR.
113
114 Calling \fBwsyncup\fR touches all locations in ancestors of \fIwin\fR that are
115 changed in \fIwin\fR.  If \fBsyncok\fR is called with second argument
116 \fBTRUE\fR then \fBwsyncup\fR is called automatically whenever there is a
117 change in the window.
118
119 The \fBwsyncdown\fR routine touches each location in \fIwin\fR that has been
120 touched in any of its ancestor windows.  This routine is called by
121 \fBwrefresh\fR, so it should almost never be necessary to call it manually.
122
123 The routine \fBwcursyncup\fR updates the current cursor position of all the
124 ancestors of the window to reflect the current cursor position of the
125 window.
126 .SH RETURN VALUE
127 Routines that return an integer return the integer \fBERR\fR upon failure and
128 \fBOK\fR (SVr4 only specifies "an integer value other than \fBERR\fR") upon
129 successful completion.
130
131 \fBdelwin\fR returns the integer \fBERR\fR upon failure and \fBOK\fR
132 upon successful completion.
133
134 Routines that return pointers return \fBNULL\fR on error.
135 .SH NOTES
136 If many small changes are made to the window, the \fBwsyncup\fR option could
137 degrade performance.
138
139 Note that \fBsyncok\fR may be a macro.
140 .SH BUGS
141 The subwindow functions (\fIsubwin\fR, \fIderwin\fR, \fImvderwin\fR,
142 \fBwsyncup\fR, \fBwsyncdown\fR, \fBwcursyncup\fR, \fBsyncok\fR) are flaky,
143 incompletely implemented, and not well tested.
144
145 The System V curses documentation is very unclear about what \fBwsyncup\fR
146 and \fBwsyncdown\fR actually do.  It seems to imply that they are only
147 supposed to touch exactly those lines that are affected by ancestor changes.
148 The language here, and the behavior of the \fBcurses\fR implementation,
149 is patterned on the XPG4 curses standard.  The weaker XPG4 spec may result
150 in slower updates.
151 .SH PORTABILITY
152 The XSI Curses standard, Issue 4 describes these functions.
153 .SH SEE ALSO
154 \fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X)
155 .\"#
156 .\"# The following sets edit modes for GNU EMACS
157 .\"# Local Variables:
158 .\"# mode:nroff
159 .\"# fill-column:79
160 .\"# End: