X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=man%2Fcurs_window.3x;h=e5ea2aaf08db4ff1e688391c90b8b18387350d94;hp=85af2e0cf8723fa87343e952484b5e7925299f3a;hb=9f479192e3ca3413d235c66bf058f8cc63764898;hpb=cef50b3afcd58166f3541b701c97bce538844c76 diff --git a/man/curs_window.3x b/man/curs_window.3x index 85af2e0c..e5ea2aaf 100644 --- a/man/curs_window.3x +++ b/man/curs_window.3x @@ -1,5 +1,6 @@ .\"*************************************************************************** -.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. * +.\" Copyright 2020,2021 Thomas E. Dickey * +.\" Copyright 1998-2015,2016 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 * @@ -26,8 +27,12 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_window.3x,v 1.16 2010/10/02 23:17:27 tom Exp $ +.\" $Id: curs_window.3x,v 1.23 2021/06/17 21:11:08 tom Exp $ .TH curs_window 3X "" +.de bP +.ie n .IP \(bu 4 +.el .IP \(bu 2 +.. .na .hy 0 .SH NAME @@ -47,81 +52,133 @@ .SH SYNOPSIS \fB#include \fR .sp -\fBWINDOW *newwin(int nlines, int ncols, int begin_y,\fR - \fBint begin_x);\fR +\fBWINDOW *newwin(\fR + \fBint \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR + \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR .br -\fBint delwin(WINDOW *win);\fR +\fBint delwin(WINDOW *\fP\fIwin\fP\fB);\fR .br -\fBint mvwin(WINDOW *win, int y, int x);\fR +\fBint mvwin(WINDOW *\fP\fIwin\fP\fB, int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fR .br -\fBWINDOW *subwin(WINDOW *orig, int nlines, int ncols,\fR - \fBint begin_y, int begin_x);\fR +\fBWINDOW *subwin(WINDOW *\fP\fIorig\fP\fB,\fR + \fBint \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR + \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR .br -\fBWINDOW *derwin(WINDOW *orig, int nlines, int ncols,\fR - \fBint begin_y, int begin_x);\fR +\fBWINDOW *derwin(WINDOW *\fP\fIorig\fP\fB,\fR + \fBint \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR + \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR .br -\fBint mvderwin(WINDOW *win, int par_y, int par_x);\fR +\fBint mvderwin(WINDOW *\fP\fIwin\fP\fB, int \fP\fIpar_y\fP\fB, int \fP\fIpar_x\fP\fB);\fR .br -\fBWINDOW *dupwin(WINDOW *win);\fR +\fBWINDOW *dupwin(WINDOW *\fP\fIwin\fP\fB);\fR .br -\fBvoid wsyncup(WINDOW *win);\fR +\fBvoid wsyncup(WINDOW *\fP\fIwin\fP\fB);\fR .br -\fBint syncok(WINDOW *win, bool bf);\fR +\fBint syncok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR .br -\fBvoid wcursyncup(WINDOW *win);\fR +\fBvoid wcursyncup(WINDOW *\fP\fIwin\fP\fB);\fR .br -\fBvoid wsyncdown(WINDOW *win);\fR +\fBvoid wsyncdown(WINDOW *\fP\fIwin\fP\fB);\fR .br .SH DESCRIPTION +.SS newwin Calling \fBnewwin\fR creates and returns a pointer to a new window with the -given number of lines and columns. The upper left-hand corner of the window is -at line \fIbegin\fR_\fIy\fR, column \fIbegin\fR_\fIx\fR. If either -\fInlines\fR or \fIncols\fR is zero, they default to \fBLINES \-\fR -\fIbegin\fR_\fIy\fR and \fBCOLS \-\fR \fIbegin\fR_\fIx\fR. A new full-screen -window is created by calling \fBnewwin(0,0,0,0)\fR. +given number of lines and columns. +The upper left-hand corner of the window is +at +.RS +line \fIbegin\fR_\fIy\fR, +.br +column \fIbegin\fR_\fIx\fR +.RE +.PP +If either +\fInlines\fR or \fIncols\fR is zero, they default to +.RS +\fBLINES \-\fR \fIbegin\fR_\fIy\fR and +.br +\fBCOLS \-\fR \fIbegin\fR_\fIx\fR. +.RE +.PP +A new full-screen window is created by calling \fBnewwin(0,0,0,0)\fR. +.PP +Regardless of the function used for creating a new window +(e.g., \fBnewwin\fP, \fBsubwin\fP, \fBderwin\fP, \fBnewpad\fP), +rather than a duplicate (with \fBdupwin\fP), +all of the window modes are initialized to the default values. +These functions set window modes after a window is created: +.RS +.na +.PP +idcok, +idlok, +immedok, +keypad, +leaveok, +nodelay, +scrollok, +setscrreg, +syncok, +wbkgdset, +wbkgrndset, and +wtimeout +.RE +.ad +.SS delwin .PP Calling \fBdelwin\fR 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. +image). +Subwindows must be deleted before the main window can be deleted. +.SS mvwin .PP Calling \fBmvwin\fR moves the window so that the upper left-hand -corner is at position (\fIx\fR, \fIy\fR). 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. +corner is at position (\fIx\fR, \fIy\fR). +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. +.SS subwin .PP Calling \fBsubwin\fR creates and returns a pointer to a new window -with the given number of lines, \fInlines\fR, and columns, -\fIncols\fR. The window is at position (\fIbegin\fR_\fIy\fR, -\fIbegin\fR_\fIx\fR) on the screen. (This position is relative to the -screen, and not to the window \fIorig\fR.) The window is made in the -middle of the window \fIorig\fR, so that changes made to one window -will affect both windows. The subwindow shares memory with the window -\fIorig\fR. When using this routine, it is necessary to call +with the given number of lines, \fInlines\fR, and columns, \fIncols\fR. +The window is at position (\fIbegin\fR_\fIy\fR, +\fIbegin\fR_\fIx\fR) on the screen. +The subwindow shares memory with the window \fIorig\fR, +so that changes made to one window +will affect both windows. +When using this routine, it is necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before calling \fBwrefresh\fR on the subwindow. +.SS derwin .PP Calling \fBderwin\fR is the same as calling \fBsubwin,\fR except that \fIbegin\fR_\fIy\fR and \fIbegin\fR_\fIx\fR are relative to the origin -of the window \fIorig\fR rather than the screen. There is no -difference between the subwindows and the derived windows. +of the window \fIorig\fR rather than the screen. +There is no difference between the subwindows and the derived windows. .PP Calling \fBmvderwin\fR 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 +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. +.SS dupwin .PP Calling \fBdupwin\fR creates an exact duplicate of the window \fIwin\fR. +.SS wsyncup .PP Calling \fBwsyncup\fR touches all locations in ancestors of \fIwin\fR that are -changed in \fIwin\fR. If \fBsyncok\fR is called with second argument +changed in \fIwin\fR. +If \fBsyncok\fR is called with second argument \fBTRUE\fR then \fBwsyncup\fR is called automatically whenever there is a change in the window. +.SS wsyncdown .PP The \fBwsyncdown\fR routine touches each location in \fIwin\fR that has been -touched in any of its ancestor windows. This routine is called by +touched in any of its ancestor windows. +This routine is called by \fBwrefresh\fR, so it should almost never be necessary to call it manually. +.SS wcursyncup .PP The routine \fBwcursyncup\fR updates the current cursor position of all the ancestors of the window to reflect the current cursor position of the @@ -135,11 +192,18 @@ Routines that return pointers return \fBNULL\fR on error. .PP X/Open defines no error conditions. In this implementation -.RS .TP 5 \fBdelwin\fR returns an error if the window pointer is null, or if the window is the parent of another window. +.TP 5 +\fBderwin\fP +returns an error if the parent window pointer is null, or +if any of its ordinates or dimensions is negative, or +if the resulting window does not fit inside the parent window. +.TP 5 +\fBdupwin\fP +returns an error if the window pointer is null. .IP This implementation also maintains a list of windows, and checks that the pointer passed to \fBdelwin\fP is one that @@ -156,26 +220,40 @@ 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. .TP 5 +\fBnewwin\fP +will fail if either of its beginning ordinates is negative, or +if either the number of lines or columns is negative. +.TP 5 \fBsyncok\fP returns an error if the window pointer is null. -.RE +.TP 5 +\fBsubwin\fP +returns an error if the parent window pointer is null, or +if any of its ordinates or dimensions is negative, or +if the resulting window does not fit inside the parent window. +.PP +The functions which return a window pointer +may also fail if there is insufficient memory for its data structures. +Any of these functions will fail if the screen has not been initialized, +i.e., with \fBinitscr\fP or \fBnewterm\fP. .SH NOTES If many small changes are made to the window, the \fBwsyncup\fR option could degrade performance. .PP Note that \fBsyncok\fR may be a macro. .SH BUGS -The subwindow functions (\fIsubwin\fR, \fIderwin\fR, \fImvderwin\fR, +The subwindow functions (\fBsubwin\fR, \fBderwin\fR, \fBmvderwin\fR, \fBwsyncup\fR, \fBwsyncdown\fR, \fBwcursyncup\fR, \fBsyncok\fR) are flaky, incompletely implemented, and not well tested. .PP The System V curses documentation is very unclear about what \fBwsyncup\fR -and \fBwsyncdown\fR actually do. It seems to imply that they are only +and \fBwsyncdown\fR 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 \fBcurses\fR implementation, -is patterned on the XPG4 curses standard. The weaker XPG4 spec may result -in slower updates. +is patterned on the XPG4 curses standard. +The weaker XPG4 spec may result in slower updates. .SH PORTABILITY The XSI Curses standard, Issue 4 describes these functions. .SH SEE ALSO @@ -183,9 +261,3 @@ The XSI Curses standard, Issue 4 describes these functions. \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X), \fBcurs_variables\fR(3X) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: