]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_inch.3x.html
ncurses 6.2 - patch 20201219
[ncurses.git] / doc / html / man / curs_inch.3x.html
1 <!-- 
2   * t
3   ****************************************************************************
4   * Copyright 2018-2019,2020 Thomas E. Dickey                                *
5   * Copyright 1998-2010,2017 Free Software Foundation, Inc.                  *
6   *                                                                          *
7   * Permission is hereby granted, free of charge, to any person obtaining a  *
8   * copy of this software and associated documentation files (the            *
9   * "Software"), to deal in the Software without restriction, including      *
10   * without limitation the rights to use, copy, modify, merge, publish,      *
11   * distribute, distribute with modifications, sublicense, and/or sell       *
12   * copies of the Software, and to permit persons to whom the Software is    *
13   * furnished to do so, subject to the following conditions:                 *
14   *                                                                          *
15   * The above copyright notice and this permission notice shall be included  *
16   * in all copies or substantial portions of the Software.                   *
17   *                                                                          *
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
19   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
20   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
21   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
22   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
23   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
24   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
25   *                                                                          *
26   * Except as contained in this notice, the name(s) of the above copyright   *
27   * holders shall not be used in advertising or otherwise to promote the     *
28   * sale, use or other dealings in this Software without prior written       *
29   * authorization.                                                           *
30   ****************************************************************************
31   * @Id: curs_inch.3x,v 1.25 2020/10/18 00:25:23 tom Exp @
32 -->
33 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
34 <HTML>
35 <HEAD>
36 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
37 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
38 <TITLE>curs_inch 3x</TITLE>
39 <link rel="author" href="mailto:bug-ncurses@gnu.org">
40 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
41 </HEAD>
42 <BODY>
43 <H1 class="no-header">curs_inch 3x</H1>
44 <PRE>
45 <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>                                                    <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
46
47
48
49
50 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
51        <STRONG>inch</STRONG>,  <STRONG>winch</STRONG>,  <STRONG>mvinch</STRONG>,  <STRONG>mvwinch</STRONG> - get a character and attributes from a
52        <STRONG>curses</STRONG> window
53
54
55 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
56        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
57
58        <STRONG>chtype</STRONG> <STRONG>inch(void);</STRONG>
59        <STRONG>chtype</STRONG> <STRONG>winch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
60
61        <STRONG>chtype</STRONG> <STRONG>mvinch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
62        <STRONG>chtype</STRONG> <STRONG>mvwinch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
63
64
65 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
66        These routines return the character, of type  <STRONG>chtype</STRONG>,  at  the  current
67        position  in  the  named  window.   If  any attributes are set for that
68        position, their values are OR'ed into the  value  returned.   Constants
69        defined  in <STRONG>&lt;curses.h&gt;</STRONG> can be used with the <STRONG>&amp;</STRONG> (logical AND) operator to
70        extract the character or attributes alone.
71
72
73 </PRE><H3><a name="h3-Attributes">Attributes</a></H3><PRE>
74        The following bit-masks may  be  AND-ed  with  characters  returned  by
75        <STRONG>winch</STRONG>.
76
77        <STRONG>A_CHARTEXT</STRONG>     Bit-mask to extract character
78        <STRONG>A_ATTRIBUTES</STRONG>   Bit-mask to extract attributes
79        <STRONG>A_COLOR</STRONG>        Bit-mask to extract color-pair field information
80
81
82 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
83        Functions  with  a  "mv"  prefix  first perform a cursor movement using
84        <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
85        the window pointer is null.
86
87        The  <STRONG>winch</STRONG>  function  does  not  return an error if the window contains
88        characters larger than 8-bits (255).  Only the low-order 8 bits of  the
89        character are used by <STRONG>winch</STRONG>.
90
91
92 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
93        Note that all of these routines may be macros.
94
95
96 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
97        These functions are described in the XSI Curses standard, Issue 4.
98
99        Very  old systems (before standardization) provide a different function
100        with the same name:
101
102        <STRONG>o</STRONG>   The <STRONG>winch</STRONG> function was part of the  original  BSD  curses  library,
103            which   stored   a  7-bit  character  combined  with  the  <EM>standout</EM>
104            attribute.
105
106            In BSD curses, <STRONG>winch</STRONG> returned only the character  (as  an  integer)
107            with the <EM>standout</EM> attribute removed.
108
109        <STRONG>o</STRONG>   System  V  curses  added support for several video attributes which
110            could be combined with characters in the window.
111
112            Reflecting this improvement, the function was altered to return the
113            character combined with all video attributes in a <STRONG>chtype</STRONG> value.
114
115        X/Open Curses does not specify the size and layout of attributes, color
116        and character values in <STRONG>chtype</STRONG>; it is  implementation-dependent.   This
117        implementation  uses 8 bits for character values.  An application using
118        more bits,  e.g.,  a  Unicode  value,  should  use  the  wide-character
119        equivalents to these functions.
120
121
122 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
123        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
124             gives an overview of the WINDOW and <STRONG>chtype</STRONG> data types.
125
126        <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
127             goes  into  more  detail,  pointing  out  portability problems and
128             constraints on the use of <STRONG>chtype</STRONG> for returning window information.
129
130        <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
131             describes comparable functions for the  wide-character  (ncursesw)
132             library.
133
134
135
136                                                                  <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
137 </PRE>
138 <div class="nav">
139 <ul>
140 <li><a href="#h2-NAME">NAME</a></li>
141 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
142 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
143 <ul>
144 <li><a href="#h3-Attributes">Attributes</a></li>
145 </ul>
146 </li>
147 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
148 <li><a href="#h2-NOTES">NOTES</a></li>
149 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
150 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
151 </ul>
152 </div>
153 </BODY>
154 </HTML>