'\" te .\" Copyright 1989 AT&T .\" Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH CURS_OUTOPTS 3CURSES "Dec 31, 1996" .SH NAME curs_outopts, clearok, idlok, idcok, immedok, leaveok, setscrreg, wsetscrreg, scrollok, nl, nonl \- curses terminal output option control routines .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lcurses\fR [ \fIlibrary\fR ... ] #include \fBint\fR \fBclearok\fR(\fBWINDOW *\fR\fIwin\fR, \fBbool\fR \fIbf\fR); .fi .LP .nf \fBint\fR \fBidlok\fR(\fBWINDOW *\fR\fIwin\fR, \fBbool\fR \fIbf\fR); .fi .LP .nf \fBvoid\fR \fBidcok\fR(\fBWINDOW *\fR\fIwin\fR, \fBbool\fR \fIbf\fR); .fi .LP .nf \fBvoid\fR \fBimmedok\fR(\fBWINDOW *\fR\fIwin\fR, \fBbool\fR \fIbf\fR); .fi .LP .nf \fBint\fR \fBleaveok\fR(\fBWINDOW *\fR\fIwin\fR, \fBbool\fR \fIbf\fR); .fi .LP .nf \fBint\fR \fBsetscrreg\fR(\fBint\fR \fItop\fR, \fBint\fR \fIbot\fR); .fi .LP .nf \fBint\fR \fBwsetscrreg\fR(\fBWINDOW *\fR\fIwin\fR, \fBint\fR \fItop\fR, \fBint\fR \fIbot\fR); .fi .LP .nf \fBint\fR \fBscrollok\fR(\fBWINDOW *\fR\fIwin\fR, \fBbool\fR \fIbf\fR); .fi .LP .nf \fBint\fR \fBnl\fR(\fBvoid\fR); .fi .LP .nf \fBint\fR \fBnonl\fR(\fBvoid\fR); .fi .SH DESCRIPTION .sp .LP These routines set options that deal with output within \fBcurses\fR. All options are initially \fBFALSE\fR, unless otherwise stated. It is not necessary to turn these options off before calling \fBendwin()\fR. .sp .LP With the \fBclearok()\fR routine, if enabled (\fIbf\fR is \fBTRUE\fR), the next call to \fBwrefresh()\fR with this window will clear the screen completely and redraw the entire screen from scratch. This is useful when the contents of the screen are uncertain, or in some cases for a more pleasing visual effect. If the \fIwin\fR argument to \fBclearok()\fR is the global variable \fBcurscr()\fR, the next call to \fBwrefresh()\fR with any window causes the screen to be cleared and repainted from scratch. .sp .LP With the \fBidlok()\fR routine, if enabled (\fIbf\fR is \fBTRUE\fR), \fBcurses\fR considers using the hardware insert/delete line feature of terminals so equipped. If disabled (\fIbf\fR is \fBFALSE)\fR \fB,\fR \fBcurses\fR very seldom uses this feature. (The insert/delete character feature is always considered.) This option should be enabled only if the application needs insert/delete line, for example, for a screen editor. It is disabled by default because insert/delete line tends to be visually annoying when used in applications where it isn't really needed. If insert/delete line cannot be used, \fBcurses\fR redraws the changed portions of all lines. .sp .LP With the \fBidcok()\fR routine, if enabled (\fIbf\fR is \fBTRUE\fR), \fBcurses\fR considers using the hardware insert/delete character feature of terminals so equipped. This is enabled by default. .sp .LP With the \fBimmedok()\fR routine, if enabled (\fIbf\fR is \fBTRUE\fR), any change in the window image, such as the ones caused by \fBwaddch()\fR, \fBwclrtobot()\fR, \fBwscrl()\fR, etc., automatically cause a call to \fBwrefresh()\fR. However, it may degrade the performance considerably, due to repeated calls to \fBwrefresh()\fR. It is disabled by default. Normally, the hardware cursor is left at the location of the window cursor being refreshed. The \fBleaveok()\fR option allows the cursor to be left wherever the update happens to leave it. It is useful for applications where the cursor is not used, since it reduces the need for cursor motions. If possible, the cursor is made invisible when this option is enabled. .sp .LP The \fBsetscrreg()\fR and \fBwsetscrreg()\fR routines allow the application programmer to set a software scrolling region in a window. \fItop\fR and \fIbot\fR are the line numbers of the top and bottom margin of the scrolling region. (Line 0 is the top line of the window.) If this option and \fBscrollok()\fR are enabled, an attempt to move off the bottom margin line causes all lines in the scrolling region to scroll up one line. Only the text of the window is scrolled. (Note that this has nothing to do with the use of a physical scrolling region capability in the terminal, like that in the VT100. If \fBidlok()\fR is enabled and the terminal has either a scrolling region or insert/delete line capability, they will probably be used by the output routines.) .sp .LP The \fBscrollok()\fR option controls what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last line. If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom line. If enabled, (\fIbf\fR is \fBTRUE\fR), \fBwrefresh()\fR is called on the window, and the physical terminal and window are scrolled up one line. (Note that in order to get the physical scrolling effect on the terminal, it is also necessary to call \fBidlok()\fR.) .sp .LP The \fBnl()\fR and \fBnonl()\fR routines control whether newline is translated into carriage return and linefeed on output, and whether return is translated into newline on input. Initially, the translations do occur. By disabling these translations using \fBnonl()\fR, \fBcurses\fR is able to make better use of the linefeed capability, resulting in faster cursor motion. .SH RETURN VALUES .sp .LP \fBsetscrreg()\fR and \fBwsetscrreg()\fR return \fBOK\fR upon success and \fBERR\fR upon failure. All other routines that return an integer always return \fBOK\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level Unsafe .TE .SH SEE ALSO .sp .LP \fBcurs_addch\fR(3CURSES), \fBcurs_clear\fR(3CURSES), \fBcurs_initscr\fR(3CURSES), \fBcurs_refresh\fR(3CURSES), \fBcurs_scroll\fR(3CURSES), \fBcurses\fR(3CURSES), \fBattributes\fR(5) .SH NOTES .sp .LP The header <\fBcurses.h\fR> automatically includes the headers <\fBstdio.h\fR> and <\fBunctrl.h\fR>. .sp .LP Note that \fBclearok()\fR, \fBleaveok()\fR, \fBscrollok()\fR, \fBidcok()\fR, \fBnl()\fR, \fBnonl()\fR, and \fBsetscrreg()\fR may be macros. .sp .LP The \fBimmedok()\fR routine is useful for windows that are used as terminal emulators.