Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
*
Permission is hereby granted, free of charge, to any person obtaining a *
copy of this software and associated documentation files (the *
"Software"), to deal in the Software without restriction, including *
without limitation the rights to use, copy, modify, merge, publish, *
distribute, distribute with modifications, sublicense, and/or sell *
copies of the Software, and to permit persons to whom the Software is *
furnished to do so, subject to the following conditions: *
*
The above copyright notice and this permission notice shall be included *
in all copies or substantial portions of the Software. *
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
*
Except as contained in this notice, the name(s) of the above copyright *
holders shall not be used in advertising or otherwise to promote the *
sale, use or other dealings in this Software without prior written *
authorization. *
***************************************************************************
$Id: curs_window.3x,v 1.14 2006/02/25 21:49:19 tom Exp $
int delwin(WINDOW *win);
int mvwin(WINDOW *win, int y, int x);
WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x);
WINDOW *derwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x);
int mvderwin(WINDOW *win, int par_y, int par_x);
WINDOW *dupwin(WINDOW *win);
void wsyncup(WINDOW *win);
int syncok(WINDOW *win, bool bf);
void wcursyncup(WINDOW *win);
void wsyncdown(WINDOW *win);
Calling delwin deletes the named window, freeing all memory associated with it (it does not actually erase the window's screen image). Subwindows must be deleted before the main window can be deleted.
Calling mvwin moves the window so that the upper left-hand corner is at position (x, y). If the move would cause the window to be off the screen, it is an error and the window is not moved. Moving subwindows is allowed, but should be avoided.
Calling subwin creates and returns a pointer to a new window with the given number of lines, nlines, and columns, ncols. The window is at position (begin_y, begin_x) on the screen. (This position is relative to the screen, and not to the window orig.) The window is made in the middle of the window orig, so that changes made to one window will affect both windows. The subwindow shares memory with the window orig. When using this routine, it is necessary to call touchwin or touchline on orig before calling wrefresh on the subwindow.
Calling derwin is the same as calling subwin, except that begin_y and begin_x are relative to the origin of the window orig rather than the screen. There is no difference between the subwindows and the derived windows.
Calling mvderwin moves a derived window (or subwindow) inside its parent window. The screen-relative parameters of the window are not changed. This routine is used to display different parts of the parent window at the same physical position on the screen.
Calling dupwin creates an exact duplicate of the window win.
Calling wsyncup touches all locations in ancestors of win that are changed in win. If syncok is called with second argument TRUE then wsyncup is called automatically whenever there is a change in the window.
The wsyncdown routine touches each location in win that has been touched in any of its ancestor windows. This routine is called by wrefresh, so it should almost never be necessary to call it manually.
The routine wcursyncup updates the current cursor position of all the ancestors of the window to reflect the current cursor position of the window.
Routines that return pointers return NULL on error.
X/Open defines no error conditions. In this implementation
5 delwin returns an error if the window pointer is null, or if the window is the parent of another window.
This implementation also maintains a list of windows, and checks that the pointer passed to delwin is one that it created, returning an error if it was not..5 mvderwin returns an error if the window pointer is null, or if some part of the window would be placed off-screen.
5 mvwin returns an error if the window pointer is null, or if the window is really a pad, or if some part of the window would be placed off-screen.
5 syncok returns an error if the window pointer is null.
Note that syncok may be a macro.
The System V curses documentation is very unclear about what wsyncup and wsyncdown actually do. It seems to imply that they are only supposed to touch exactly those lines that are affected by ancestor changes. The language here, and the behavior of the curses implementation, is patterned on the XPG4 curses standard. The weaker XPG4 spec may result in slower updates.
# The following sets edit modes for GNU EMACS
# Local Variables:
# mode:nroff
# fill-column:79
# End: