ncursesw-morphos/doc/html/man/curs_pad.3x.html

185 lines
10 KiB
HTML
Raw Normal View History

2002-10-13 11:35:53 +08:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--
****************************************************************************
2005-10-10 02:41:57 +08:00
* Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
2002-10-13 11:35:53 +08:00
* *
* 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. *
****************************************************************************
2005-10-10 02:41:57 +08:00
* @Id: curs_pad.3x,v 1.14 2005/05/15 16:18:43 tom Exp @
2002-10-13 11:35:53 +08:00
-->
2000-07-09 10:46:08 +08:00
<HTML>
2002-10-13 11:35:53 +08:00
<HEAD>
<TITLE>curs_pad 3x</TITLE>
<link rev=made href="mailto:bug-ncurses@gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
2000-07-09 10:46:08 +08:00
<BODY>
2002-10-13 11:35:53 +08:00
<H1>curs_pad 3x</H1>
<HR>
2000-07-09 10:46:08 +08:00
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
2005-10-10 02:41:57 +08:00
<STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG> <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>
2004-02-09 10:15:26 +08:00
2000-07-09 10:46:08 +08:00
</PRE>
<H2>NAME</H2><PRE>
2005-10-10 02:41:57 +08:00
<STRONG>newpad</STRONG>, <STRONG>subpad</STRONG>, <STRONG>prefresh</STRONG>, <STRONG>pnoutrefresh</STRONG>, <STRONG>pechochar</STRONG>,
2004-02-09 10:15:26 +08:00
<STRONG>pecho_wchar</STRONG> - create and display <STRONG>curses</STRONG> pads
2000-07-09 10:46:08 +08:00
</PRE>
<H2>SYNOPSIS</H2><PRE>
2002-10-13 11:35:53 +08:00
<STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
2000-07-09 10:46:08 +08:00
2002-10-13 11:35:53 +08:00
<STRONG>WINDOW</STRONG> <STRONG>*newpad(int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols);</STRONG>
<STRONG>WINDOW</STRONG> <STRONG>*subpad(WINDOW</STRONG> <STRONG>*orig,</STRONG> <STRONG>int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols,</STRONG>
<STRONG>int</STRONG> <STRONG>begin_y,</STRONG> <STRONG>int</STRONG> <STRONG>begin_x);</STRONG>
<STRONG>int</STRONG> <STRONG>prefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
<STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
<STRONG>int</STRONG> <STRONG>pnoutrefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
<STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
<STRONG>int</STRONG> <STRONG>pechochar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
2004-02-09 10:15:26 +08:00
<STRONG>int</STRONG> <STRONG>pecho_wchar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*wch);</STRONG>
2000-07-09 10:46:08 +08:00
</PRE>
<H2>DESCRIPTION</H2><PRE>
2002-10-13 11:35:53 +08:00
The <STRONG>newpad</STRONG> routine creates and returns a pointer to a new
pad data structure with the given number of lines, <EM>nlines</EM>,
and columns, <EM>ncols</EM>. A pad is like a window, except that
2000-07-09 10:46:08 +08:00
it is not restricted by the screen size, and is not neces-
sarily associated with a particular part of the screen.
Pads can be used when a large window is needed, and only a
2005-10-10 02:41:57 +08:00
part of the window will be on the screen at one time. Au-
tomatic refreshes of pads (e.g., from scrolling or echoing
of input) do not occur. It is not legal to call <STRONG>wrefresh</STRONG>
with a <EM>pad</EM> as an argument; the routines <STRONG>prefresh</STRONG> or
2002-10-13 11:35:53 +08:00
<STRONG>pnoutrefresh</STRONG> should be called instead. Note that these
2000-07-09 10:46:08 +08:00
routines require additional parameters to specify the part
of the pad to be displayed and the location on the screen
to be used for the display.
2002-10-13 11:35:53 +08:00
The <STRONG>subpad</STRONG> routine creates and returns a pointer to a sub-
2000-07-09 10:46:08 +08:00
window within a pad with the given number of lines,
2002-10-13 11:35:53 +08:00
<EM>nlines</EM>, and columns, <EM>ncols</EM>. Unlike <STRONG>subwin</STRONG>, which uses
screen coordinates, the window is at position (<EM>begin</EM>_<EM>x</EM><STRONG>,</STRONG>
<EM>begin</EM>_<EM>y</EM>) on the pad. The window is made in the middle of
the window <EM>orig</EM>, so that changes made to one window affect
2005-10-10 02:41:57 +08:00
both windows. During the use of this routine, it will of-
ten be necessary to call <STRONG>touchwin</STRONG> or <STRONG>touchline</STRONG> on <EM>orig</EM> be-
fore calling <STRONG>prefresh</STRONG>.
2000-07-09 10:46:08 +08:00
2002-10-13 11:35:53 +08:00
The <STRONG>prefresh</STRONG> and <STRONG>pnoutrefresh</STRONG> routines are analogous to
<STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> except that they relate to pads
2000-07-09 10:46:08 +08:00
instead of windows. The additional parameters are needed
to indicate what part of the pad and screen are involved.
2002-10-13 11:35:53 +08:00
<EM>pminrow</EM> and <EM>pmincol</EM> specify the upper left-hand corner of
the rectangle to be displayed in the pad. <EM>sminrow</EM>, <EM>smin-</EM>
<EM>col</EM>, <EM>smaxrow</EM>, and <EM>smaxcol</EM> specify the edges of the rectan-
2000-07-09 10:46:08 +08:00
gle to be displayed on the screen. The lower right-hand
corner of the rectangle to be displayed in the pad is cal-
culated from the screen coordinates, since the rectangles
must be the same size. Both rectangles must be entirely
contained within their respective structures. Negative
2005-10-10 02:41:57 +08:00
values of <EM>pminrow</EM>, <EM>pmincol</EM>, <EM>sminrow</EM>, or <EM>smincol</EM> are treat-
ed as if they were zero.
2000-07-09 10:46:08 +08:00
2002-10-13 11:35:53 +08:00
The <STRONG>pechochar</STRONG> routine is functionally equivalent to a call
to <STRONG>addch</STRONG> followed by a call to <STRONG>refresh</STRONG>, a call to <STRONG>waddch</STRONG>
followed by a call to <STRONG>wrefresh</STRONG>, or a call to <STRONG>waddch</STRONG> fol-
2004-02-09 10:15:26 +08:00
lowed by a call to <STRONG>prefresh</STRONG>. The knowledge that only a
2000-07-09 10:46:08 +08:00
single character is being output is taken into considera-
tion and, for non-control characters, a considerable per-
2005-10-10 02:41:57 +08:00
formance gain might be seen by using these routines in-
stead of their equivalents. In the case of <STRONG>pechochar</STRONG>, the
last location of the pad on the screen is reused for the
arguments to <STRONG>prefresh</STRONG>.
2000-07-09 10:46:08 +08:00
2004-02-09 10:15:26 +08:00
The <STRONG>pecho_wchar</STRONG> function is the analogous wide-character
form of <STRONG>pechochar</STRONG>. It outputs one character to a pad and
immediately refreshes the pad. It does this by a call to
<STRONG>wadd_wch</STRONG> followed by a call to <STRONG>prefresh</STRONG>.
2000-07-09 10:46:08 +08:00
</PRE>
<H2>RETURN VALUE</H2><PRE>
2004-02-09 10:15:26 +08:00
Routines that return an integer return <STRONG>ERR</STRONG> upon failure
and <STRONG>OK</STRONG> (SVr4 only specifies "an integer value other than
2002-10-13 11:35:53 +08:00
<STRONG>ERR</STRONG>") upon successful completion.
2000-07-09 10:46:08 +08:00
2004-02-09 10:15:26 +08:00
Routines that return pointers return <STRONG>NULL</STRONG> on error, and
2002-10-13 11:35:53 +08:00
set <STRONG>errno</STRONG> to <STRONG>ENOMEM</STRONG>.
2000-07-09 10:46:08 +08:00
2005-10-10 02:41:57 +08:00
X/Open does not define any error conditions. In this im-
plementation
<STRONG>prefresh</STRONG> and <STRONG>pnoutrefresh</STRONG>
return an error if the window pointer is null,
or if the window is not really a pad or if the
area to refresh extends off-screen or if the
minimum coordinates are greater than the maxi-
mum.
<STRONG>pechochar</STRONG>
returns an error if the window is not really a
pad, and the associated call to <STRONG>wechochar</STRONG> re-
turns an error.
<STRONG>pecho_wchar</STRONG>
returns an error if the window is not really a
pad, and the associated call to <STRONG>wecho_wchar</STRONG>
returns an error.
2000-07-09 10:46:08 +08:00
</PRE>
<H2>NOTES</H2><PRE>
2002-10-13 11:35:53 +08:00
Note that <STRONG>pechochar</STRONG> may be a macro.
2000-07-09 10:46:08 +08:00
</PRE>
<H2>PORTABILITY</H2><PRE>
2005-10-10 02:41:57 +08:00
The XSI Curses standard, Issue 4 describes these func-
2000-07-09 10:46:08 +08:00
tions.
</PRE>
<H2>SEE ALSO</H2><PRE>
2005-10-10 02:41:57 +08:00
<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>
<STRONG><A HREF="curs_addch.3x.html">ch(3x)</A></STRONG>.
2000-07-09 10:46:08 +08:00
2005-10-10 02:41:57 +08:00
<STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>
2000-07-09 10:46:08 +08:00
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>