| 1 |
<!-- |
| 2 |
**************************************************************************** |
| 3 |
* Copyright 2019-2024,2025 Thomas E. Dickey * |
| 4 |
* Copyright 2007-2015,2017 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_legacy.3x,v 1.36 2025/02/15 18:43:02 tom Exp @ |
| 31 |
--> |
| 32 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
| 33 |
<HTML> |
| 34 |
<HEAD> |
| 35 |
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 36 |
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts"> |
| 37 |
<TITLE>curs_legacy 3x 2025-02-15 ncurses 6.6 Library calls</TITLE> |
| 38 |
<link rel="author" href="mailto:[email protected]"> |
| 39 |
|
| 40 |
</HEAD> |
| 41 |
<BODY> |
| 42 |
<H1 class="no-header">curs_legacy 3x 2025-02-15 ncurses 6.6 Library calls</H1> |
| 43 |
<PRE> |
| 44 |
<STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG> |
| 45 |
|
| 46 |
|
| 47 |
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE> |
| 48 |
<STRONG>getattrs</STRONG>, <STRONG>getbegx</STRONG>, <STRONG>getbegy</STRONG>, <STRONG>getcurx</STRONG>, <STRONG>getcury</STRONG>, <STRONG>getmaxx</STRONG>, <STRONG>getmaxy</STRONG>, |
| 49 |
<STRONG>getparx</STRONG>, <STRONG>getpary</STRONG> - get <EM>curses</EM> cursor and window coordinates or |
| 50 |
attributes (legacy) |
| 51 |
|
| 52 |
|
| 53 |
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> |
| 54 |
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG> |
| 55 |
|
| 56 |
<STRONG>int</STRONG> <STRONG>getattrs(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 57 |
|
| 58 |
<STRONG>int</STRONG> <STRONG>getbegx(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 59 |
<STRONG>int</STRONG> <STRONG>getbegy(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 60 |
|
| 61 |
<STRONG>int</STRONG> <STRONG>getcurx(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 62 |
<STRONG>int</STRONG> <STRONG>getcury(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 63 |
|
| 64 |
<STRONG>int</STRONG> <STRONG>getmaxx(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 65 |
<STRONG>int</STRONG> <STRONG>getmaxy(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 66 |
|
| 67 |
<STRONG>int</STRONG> <STRONG>getparx(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 68 |
<STRONG>int</STRONG> <STRONG>getpary(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 69 |
|
| 70 |
|
| 71 |
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> |
| 72 |
These legacy functions are simpler to use than the X/Open <EM>curses</EM> |
| 73 |
functions: |
| 74 |
|
| 75 |
<STRONG>o</STRONG> The <STRONG>getattrs</STRONG> function returns the same attribute data as <STRONG>wattr_get</STRONG>. |
| 76 |
|
| 77 |
However, <STRONG>getattrs</STRONG> returns an integer (actually a <STRONG>chtype</STRONG>), while |
| 78 |
<STRONG>wattr_get</STRONG> returns the current color pair in a separate parameter. |
| 79 |
In the wide-character library configuration, color pairs may not |
| 80 |
fit into a <STRONG>chtype</STRONG>, so <STRONG>wattr_get</STRONG> is the only way to obtain the color |
| 81 |
information. |
| 82 |
|
| 83 |
Because <STRONG>getattrs</STRONG> returns the attributes in a single parameter, it |
| 84 |
would not be possible for an application to distinguish that from |
| 85 |
<STRONG>ERR</STRONG> (a <EM>-1</EM>). If the window parameter is null, <STRONG>getattrs</STRONG> returns |
| 86 |
<STRONG>A_NORMAL</STRONG> (zero). |
| 87 |
|
| 88 |
<STRONG>o</STRONG> The <STRONG>getbegy</STRONG> and <STRONG>getbegx</STRONG> functions return the same data as <STRONG>getbegyx</STRONG>. |
| 89 |
|
| 90 |
<STRONG>o</STRONG> The <STRONG>getcury</STRONG> and <STRONG>getcurx</STRONG> functions return the same data as <STRONG>getyx</STRONG>. |
| 91 |
|
| 92 |
<STRONG>o</STRONG> The <STRONG>getmaxy</STRONG> and <STRONG>getmaxx</STRONG> functions return the same data as <STRONG>getmaxyx</STRONG>. |
| 93 |
|
| 94 |
<STRONG>o</STRONG> The <STRONG>getpary</STRONG> and <STRONG>getparx</STRONG> functions return the same data as <STRONG>getparyx</STRONG>. |
| 95 |
|
| 96 |
|
| 97 |
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> |
| 98 |
Except as noted, these functions return an integer, or <STRONG>ERR</STRONG> if the |
| 99 |
window parameter is null. |
| 100 |
|
| 101 |
|
| 102 |
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> |
| 103 |
These functions were supported on Version 7, BSD or System V |
| 104 |
implementations. None of those implementations checked the window |
| 105 |
parameter. |
| 106 |
|
| 107 |
The <STRONG>getattrs</STRONG> function and macro are defined to return a (signed) |
| 108 |
integer for compatibility with those implementations although an |
| 109 |
unsigned type would have been more appropriate. |
| 110 |
|
| 111 |
|
| 112 |
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> |
| 113 |
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3x)</A></STRONG>, <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG> |
| 114 |
|
| 115 |
ncurses 6.6 2025-02-15 <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG> |
| 116 |
</PRE> |
| 117 |
<div class="nav"> |
| 118 |
<ul> |
| 119 |
<li><a href="#h2-NAME">NAME</a></li> |
| 120 |
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> |
| 121 |
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li> |
| 122 |
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> |
| 123 |
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li> |
| 124 |
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> |
| 125 |
</ul> |
| 126 |
</div> |
| 127 |
</BODY> |
| 128 |
</HTML> |