curs_pad.3x.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  2. <!--
  3. ****************************************************************************
  4. * Copyright (c) 1998-2004,2005 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_pad.3x,v 1.14 2005/05/15 16:18:43 tom Exp @
  31. -->
  32. <HTML>
  33. <HEAD>
  34. <TITLE>curs_pad 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_pad 3x</H1>
  40. <HR>
  41. <PRE>
  42. <!-- Manpage converted by man2html 3.0.1 -->
  43. <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG> <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>
  44. </PRE>
  45. <H2>NAME</H2><PRE>
  46. <STRONG>newpad</STRONG>, <STRONG>subpad</STRONG>, <STRONG>prefresh</STRONG>, <STRONG>pnoutrefresh</STRONG>, <STRONG>pechochar</STRONG>,
  47. <STRONG>pecho_wchar</STRONG> - create and display <STRONG>curses</STRONG> pads
  48. </PRE>
  49. <H2>SYNOPSIS</H2><PRE>
  50. <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
  51. <STRONG>WINDOW</STRONG> <STRONG>*newpad(int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols);</STRONG>
  52. <STRONG>WINDOW</STRONG> <STRONG>*subpad(WINDOW</STRONG> <STRONG>*orig,</STRONG> <STRONG>int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols,</STRONG>
  53. <STRONG>int</STRONG> <STRONG>begin_y,</STRONG> <STRONG>int</STRONG> <STRONG>begin_x);</STRONG>
  54. <STRONG>int</STRONG> <STRONG>prefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
  55. <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
  56. <STRONG>int</STRONG> <STRONG>pnoutrefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
  57. <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
  58. <STRONG>int</STRONG> <STRONG>pechochar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
  59. <STRONG>int</STRONG> <STRONG>pecho_wchar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*wch);</STRONG>
  60. </PRE>
  61. <H2>DESCRIPTION</H2><PRE>
  62. The <STRONG>newpad</STRONG> routine creates and returns a pointer to a new
  63. pad data structure with the given number of lines, <EM>nlines</EM>,
  64. and columns, <EM>ncols</EM>. A pad is like a window, except that
  65. it is not restricted by the screen size, and is not neces-
  66. sarily associated with a particular part of the screen.
  67. Pads can be used when a large window is needed, and only a
  68. part of the window will be on the screen at one time. Au-
  69. tomatic refreshes of pads (e.g., from scrolling or echoing
  70. of input) do not occur. It is not legal to call <STRONG>wrefresh</STRONG>
  71. with a <EM>pad</EM> as an argument; the routines <STRONG>prefresh</STRONG> or
  72. <STRONG>pnoutrefresh</STRONG> should be called instead. Note that these
  73. routines require additional parameters to specify the part
  74. of the pad to be displayed and the location on the screen
  75. to be used for the display.
  76. The <STRONG>subpad</STRONG> routine creates and returns a pointer to a sub-
  77. window within a pad with the given number of lines,
  78. <EM>nlines</EM>, and columns, <EM>ncols</EM>. Unlike <STRONG>subwin</STRONG>, which uses
  79. screen coordinates, the window is at position (<EM>begin</EM>_<EM>x</EM><STRONG>,</STRONG>
  80. <EM>begin</EM>_<EM>y</EM>) on the pad. The window is made in the middle of
  81. the window <EM>orig</EM>, so that changes made to one window affect
  82. both windows. During the use of this routine, it will of-
  83. ten be necessary to call <STRONG>touchwin</STRONG> or <STRONG>touchline</STRONG> on <EM>orig</EM> be-
  84. fore calling <STRONG>prefresh</STRONG>.
  85. The <STRONG>prefresh</STRONG> and <STRONG>pnoutrefresh</STRONG> routines are analogous to
  86. <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> except that they relate to pads
  87. instead of windows. The additional parameters are needed
  88. to indicate what part of the pad and screen are involved.
  89. <EM>pminrow</EM> and <EM>pmincol</EM> specify the upper left-hand corner of
  90. the rectangle to be displayed in the pad. <EM>sminrow</EM>, <EM>smin-</EM>
  91. <EM>col</EM>, <EM>smaxrow</EM>, and <EM>smaxcol</EM> specify the edges of the rectan-
  92. gle to be displayed on the screen. The lower right-hand
  93. corner of the rectangle to be displayed in the pad is cal-
  94. culated from the screen coordinates, since the rectangles
  95. must be the same size. Both rectangles must be entirely
  96. contained within their respective structures. Negative
  97. values of <EM>pminrow</EM>, <EM>pmincol</EM>, <EM>sminrow</EM>, or <EM>smincol</EM> are treat-
  98. ed as if they were zero.
  99. The <STRONG>pechochar</STRONG> routine is functionally equivalent to a call
  100. to <STRONG>addch</STRONG> followed by a call to <STRONG>refresh</STRONG>, a call to <STRONG>waddch</STRONG>
  101. followed by a call to <STRONG>wrefresh</STRONG>, or a call to <STRONG>waddch</STRONG> fol-
  102. lowed by a call to <STRONG>prefresh</STRONG>. The knowledge that only a
  103. single character is being output is taken into considera-
  104. tion and, for non-control characters, a considerable per-
  105. formance gain might be seen by using these routines in-
  106. stead of their equivalents. In the case of <STRONG>pechochar</STRONG>, the
  107. last location of the pad on the screen is reused for the
  108. arguments to <STRONG>prefresh</STRONG>.
  109. The <STRONG>pecho_wchar</STRONG> function is the analogous wide-character
  110. form of <STRONG>pechochar</STRONG>. It outputs one character to a pad and
  111. immediately refreshes the pad. It does this by a call to
  112. <STRONG>wadd_wch</STRONG> followed by a call to <STRONG>prefresh</STRONG>.
  113. </PRE>
  114. <H2>RETURN VALUE</H2><PRE>
  115. Routines that return an integer return <STRONG>ERR</STRONG> upon failure
  116. and <STRONG>OK</STRONG> (SVr4 only specifies "an integer value other than
  117. <STRONG>ERR</STRONG>") upon successful completion.
  118. Routines that return pointers return <STRONG>NULL</STRONG> on error, and
  119. set <STRONG>errno</STRONG> to <STRONG>ENOMEM</STRONG>.
  120. X/Open does not define any error conditions. In this im-
  121. plementation
  122. <STRONG>prefresh</STRONG> and <STRONG>pnoutrefresh</STRONG>
  123. return an error if the window pointer is null,
  124. or if the window is not really a pad or if the
  125. area to refresh extends off-screen or if the
  126. minimum coordinates are greater than the maxi-
  127. mum.
  128. <STRONG>pechochar</STRONG>
  129. returns an error if the window is not really a
  130. pad, and the associated call to <STRONG>wechochar</STRONG> re-
  131. turns an error.
  132. <STRONG>pecho_wchar</STRONG>
  133. returns an error if the window is not really a
  134. pad, and the associated call to <STRONG>wecho_wchar</STRONG>
  135. returns an error.
  136. </PRE>
  137. <H2>NOTES</H2><PRE>
  138. Note that <STRONG>pechochar</STRONG> may be a macro.
  139. </PRE>
  140. <H2>PORTABILITY</H2><PRE>
  141. The XSI Curses standard, Issue 4 describes these func-
  142. tions.
  143. </PRE>
  144. <H2>SEE ALSO</H2><PRE>
  145. <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_touch.3x.html">curs_touch(3x)</A></STRONG>, <STRONG>curs_add-</STRONG>
  146. <STRONG><A HREF="curs_addch.3x.html">ch(3x)</A></STRONG>.
  147. <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>
  148. </PRE>
  149. <HR>
  150. <ADDRESS>
  151. Man(1) output converted with
  152. <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
  153. </ADDRESS>
  154. </BODY>
  155. </HTML>