curs_outopts.3x.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  2. <!--
  3. ****************************************************************************
  4. * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
  5. * *
  6. * Permission is hereby granted, free of charge, to any person obtaining a *
  7. * copy of this software and associated documentation files (the *
  8. * "Software"), to deal in the Software without restriction, including *
  9. * without limitation the rights to use, copy, modify, merge, publish, *
  10. * distribute, distribute with modifications, sublicense, and/or sell *
  11. * copies of the Software, and to permit persons to whom the Software is *
  12. * furnished to do so, subject to the following conditions: *
  13. * *
  14. * The above copyright notice and this permission notice shall be included *
  15. * in all copies or substantial portions of the Software. *
  16. * *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
  18. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
  20. * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
  21. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
  22. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
  23. * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  24. * *
  25. * Except as contained in this notice, the name(s) of the above copyright *
  26. * holders shall not be used in advertising or otherwise to promote the *
  27. * sale, use or other dealings in this Software without prior written *
  28. * authorization. *
  29. ****************************************************************************
  30. * @Id: curs_outopts.3x,v 1.21 2007/06/02 20:40:07 tom Exp @
  31. -->
  32. <HTML>
  33. <HEAD>
  34. <TITLE>curs_outopts 3x</TITLE>
  35. <link rev=made href="mailto:bug-ncurses@gnu.org">
  36. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  37. </HEAD>
  38. <BODY>
  39. <H1>curs_outopts 3x</H1>
  40. <HR>
  41. <PRE>
  42. <!-- Manpage converted by man2html 3.0.1 -->
  43. <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG> <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
  44. </PRE>
  45. <H2>NAME</H2><PRE>
  46. <STRONG>clearok</STRONG>, <STRONG>idlok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>immedok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>setscrreg</STRONG>,
  47. <STRONG>wsetscrreg</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> - <STRONG>curses</STRONG> output options
  48. </PRE>
  49. <H2>SYNOPSIS</H2><PRE>
  50. <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
  51. <STRONG>int</STRONG> <STRONG>clearok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
  52. <STRONG>int</STRONG> <STRONG>idlok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
  53. <STRONG>void</STRONG> <STRONG>idcok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
  54. <STRONG>void</STRONG> <STRONG>immedok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
  55. <STRONG>int</STRONG> <STRONG>leaveok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
  56. <STRONG>int</STRONG> <STRONG>setscrreg(int</STRONG> <STRONG>top,</STRONG> <STRONG>int</STRONG> <STRONG>bot);</STRONG>
  57. <STRONG>int</STRONG> <STRONG>wsetscrreg(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>top,</STRONG> <STRONG>int</STRONG> <STRONG>bot);</STRONG>
  58. <STRONG>int</STRONG> <STRONG>scrollok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
  59. <STRONG>int</STRONG> <STRONG>nl(void);</STRONG>
  60. <STRONG>int</STRONG> <STRONG>nonl(void);</STRONG>
  61. </PRE>
  62. <H2>DESCRIPTION</H2><PRE>
  63. These routines set options that change the style of output
  64. within <STRONG>curses</STRONG>. All options are initially <STRONG>FALSE</STRONG>, unless
  65. otherwise stated. It is not necessary to turn these op-
  66. tions off before calling <STRONG>endwin</STRONG>.
  67. If <STRONG>clearok</STRONG> is called with <STRONG>TRUE</STRONG> as argument, the next call
  68. to <STRONG>wrefresh</STRONG> with this window will clear the screen com-
  69. pletely and redraw the entire screen from scratch. This
  70. is useful when the contents of the screen are uncertain,
  71. or in some cases for a more pleasing visual effect. If
  72. the <EM>win</EM> argument to <STRONG>clearok</STRONG> is the global variable <STRONG>curscr</STRONG>,
  73. the next call to <STRONG>wrefresh</STRONG> with any window causes the
  74. screen to be cleared and repainted from scratch.
  75. If <STRONG>idlok</STRONG> is called with <STRONG>TRUE</STRONG> as second argument, <STRONG>curses</STRONG>
  76. considers using the hardware insert/delete line feature of
  77. terminals so equipped. Calling <STRONG>idlok</STRONG> with <STRONG>FALSE</STRONG> as second
  78. argument disables use of line insertion and deletion.
  79. This option should be enabled only if the application
  80. needs insert/delete line, for example, for a screen edi-
  81. tor. It is disabled by default because insert/delete line
  82. tends to be visually annoying when used in applications
  83. where it is not really needed. If insert/delete line can-
  84. not be used, <STRONG>curses</STRONG> redraws the changed portions of all
  85. lines.
  86. If <STRONG>idcok</STRONG> is called with <STRONG>FALSE</STRONG> as second argument, <STRONG>curses</STRONG>
  87. no longer considers using the hardware insert/delete char-
  88. acter feature of terminals so equipped. Use of character
  89. insert/delete is enabled by default. Calling <STRONG>idcok</STRONG> with
  90. <STRONG>TRUE</STRONG> as second argument re-enables use of character inser-
  91. tion and deletion.
  92. If <STRONG>immedok</STRONG> is called with <STRONG>TRUE</STRONG> <STRONG>as</STRONG> <STRONG>argument</STRONG>, any change in
  93. the window image, such as the ones caused by <STRONG>waddch,</STRONG> <STRONG>wclr-</STRONG>
  94. <STRONG>tobot,</STRONG> <STRONG>wscrl</STRONG>, etc., automatically cause a call to <STRONG>wre-</STRONG>
  95. <STRONG>fresh</STRONG>. However, it may degrade performance considerably,
  96. due to repeated calls to <STRONG>wrefresh</STRONG>. It is disabled by de-
  97. fault.
  98. Normally, the hardware cursor is left at the location of
  99. the window cursor being refreshed. The <STRONG>leaveok</STRONG> option al-
  100. lows the cursor to be left wherever the update happens to
  101. leave it. It is useful for applications where the cursor
  102. is not used, since it reduces the need for cursor motions.
  103. The <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> routines allow the applica-
  104. tion programmer to set a software scrolling region in a
  105. window. <EM>top</EM> and <EM>bot</EM> are the line numbers of the top and
  106. bottom margin of the scrolling region. (Line 0 is the top
  107. line of the window.) If this option and <STRONG>scrollok</STRONG> are en-
  108. abled, an attempt to move off the bottom margin line caus-
  109. es all lines in the scrolling region to scroll one line in
  110. the direction of the first line. Only the text of the
  111. window is scrolled. (Note that this has nothing to do
  112. with the use of a physical scrolling region capability in
  113. the terminal, like that in the VT100. If <STRONG>idlok</STRONG> is enabled
  114. and the terminal has either a scrolling region or in-
  115. sert/delete line capability, they will probably be used by
  116. the output routines.)
  117. The <STRONG>scrollok</STRONG> option controls what happens when the cursor
  118. of a window is moved off the edge of the window or
  119. scrolling region, either as a result of a newline action
  120. on the bottom line, or typing the last character of the
  121. last line. If disabled, (<EM>bf</EM> is <STRONG>FALSE</STRONG>), the cursor is left
  122. on the bottom line. If enabled, (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the window
  123. is scrolled up one line (Note that to get the physical
  124. scrolling effect on the terminal, it is also necessary to
  125. call <STRONG>idlok</STRONG>).
  126. The <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> routines control whether the underlying
  127. display device translates the return key into newline on
  128. input, and whether it translates newline into return and
  129. line-feed on output (in either case, the call <STRONG>addch('\n')</STRONG>
  130. does the equivalent of return and line feed on the virtual
  131. screen). Initially, these translations do occur. If you
  132. disable them using <STRONG>nonl</STRONG>, <STRONG>curses</STRONG> will be able to make bet-
  133. ter use of the line-feed capability, resulting in faster
  134. cursor motion. Also, <STRONG>curses</STRONG> will then be able to detect
  135. the return key.
  136. </PRE>
  137. <H2>RETURN VALUE</H2><PRE>
  138. The functions <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> return <STRONG>OK</STRONG> upon suc-
  139. cess and <STRONG>ERR</STRONG> upon failure. All other routines that return
  140. an integer always return <STRONG>OK</STRONG>.
  141. X/Open does not define any error conditions.
  142. In this implementation, those functions that have a window
  143. pointer will return an error if the window pointer is
  144. null.
  145. <STRONG>wclrtoeol</STRONG>
  146. returns an error if the cursor position is
  147. about to wrap.
  148. <STRONG>wsetscrreg</STRONG>
  149. returns an error if the scrolling region lim-
  150. its extend outside the window.
  151. X/Open does not define any error conditions. This imple-
  152. mentation returns an error if the window pointer is null.
  153. </PRE>
  154. <H2>PORTABILITY</H2><PRE>
  155. These functions are described in the XSI Curses standard,
  156. Issue 4.
  157. The XSI Curses standard is ambiguous on the question of
  158. whether <STRONG>raw</STRONG>() should disable the CRLF translations con-
  159. trolled by <STRONG>nl</STRONG>() and <STRONG>nonl</STRONG>(). BSD curses did turn off these
  160. translations; AT&amp;T curses (at least as late as SVr1) did
  161. not. We choose to do so, on the theory that a programmer
  162. requesting raw input wants a clean (ideally 8-bit clean)
  163. connection that the operating system will not alter.
  164. Some historic curses implementations had, as an undocu-
  165. mented feature, the ability to do the equivalent of
  166. <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
  167. <STRONG>scr)</STRONG>. This will not work under ncurses.
  168. Earlier System V curses implementations specified that
  169. with <STRONG>scrollok</STRONG> enabled, any window modification triggering
  170. a scroll also forced a physical refresh. XSI Curses does
  171. not require this, and <STRONG>ncurses</STRONG> avoids doing it to perform
  172. better vertical-motion optimization at <STRONG>wrefresh</STRONG> time.
  173. The XSI Curses standard does not mention that the cursor
  174. should be made invisible as a side-effect of <STRONG>leaveok</STRONG>.
  175. SVr4 curses documentation does this, but the code does
  176. not. Use <STRONG>curs_set</STRONG> to make the cursor invisible.
  177. </PRE>
  178. <H2>NOTES</H2><PRE>
  179. Note that <STRONG>clearok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> and
  180. <STRONG>setscrreg</STRONG> may be macros.
  181. The <STRONG>immedok</STRONG> routine is useful for windows that are used as
  182. terminal emulators.
  183. </PRE>
  184. <H2>SEE ALSO</H2><PRE>
  185. <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>,
  186. <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>
  187. <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
  188. </PRE>
  189. <HR>
  190. <ADDRESS>
  191. Man(1) output converted with
  192. <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
  193. </ADDRESS>
  194. </BODY>
  195. </HTML>