| 1 |
.\"*************************************************************************** |
| 2 |
.\" Copyright 2019-2024,2025 Thomas E. Dickey * |
| 3 |
.\" Copyright 2007-2015,2017 Free Software Foundation, Inc. * |
| 4 |
.\" * |
| 5 |
.\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 |
.\" copy of this software and associated documentation files (the * |
| 7 |
.\" "Software"), to deal in the Software without restriction, including * |
| 8 |
.\" without limitation the rights to use, copy, modify, merge, publish, * |
| 9 |
.\" distribute, distribute with modifications, sublicense, and/or sell * |
| 10 |
.\" copies of the Software, and to permit persons to whom the Software is * |
| 11 |
.\" furnished to do so, subject to the following conditions: * |
| 12 |
.\" * |
| 13 |
.\" The above copyright notice and this permission notice shall be included * |
| 14 |
.\" in all copies or substantial portions of the Software. * |
| 15 |
.\" * |
| 16 |
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 |
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 |
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 |
.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 |
.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 |
.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 |
.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 |
.\" * |
| 24 |
.\" Except as contained in this notice, the name(s) of the above copyright * |
| 25 |
.\" holders shall not be used in advertising or otherwise to promote the * |
| 26 |
.\" sale, use or other dealings in this Software without prior written * |
| 27 |
.\" authorization. * |
| 28 |
.\"*************************************************************************** |
| 29 |
.\" |
| 30 |
.\" $Id: curs_legacy.3x,v 1.36 2025/02/15 18:43:02 tom Exp $ |
| 31 |
.TH legacy 3NCURSES 2025-02-15 "ncurses 6.6" "Library calls" |
| 32 |
.de bP |
| 33 |
.ie n .IP \(bu 4 |
| 34 |
.el .IP \(bu 2 |
| 35 |
.. |
| 36 |
.SH NAME |
| 37 |
\fB\%getattrs\fP, |
| 38 |
\fB\%getbegx\fP, |
| 39 |
\fB\%getbegy\fP, |
| 40 |
\fB\%getcurx\fP, |
| 41 |
\fB\%getcury\fP, |
| 42 |
\fB\%getmaxx\fP, |
| 43 |
\fB\%getmaxy\fP, |
| 44 |
\fB\%getparx\fP, |
| 45 |
\fB\%getpary\fP \- |
| 46 |
get \fIcurses\fR cursor and window coordinates or attributes (legacy) |
| 47 |
.SH SYNOPSIS |
| 48 |
.nf |
| 49 |
\fB#include <curses.h> |
| 50 |
.PP |
| 51 |
\fBint getattrs(const WINDOW *\fIwin\fP); |
| 52 |
.PP |
| 53 |
\fBint getbegx(const WINDOW *\fIwin\fP); |
| 54 |
\fBint getbegy(const WINDOW *\fIwin\fP); |
| 55 |
.PP |
| 56 |
\fBint getcurx(const WINDOW *\fIwin\fP); |
| 57 |
\fBint getcury(const WINDOW *\fIwin\fP); |
| 58 |
.PP |
| 59 |
\fBint getmaxx(const WINDOW *\fIwin\fP); |
| 60 |
\fBint getmaxy(const WINDOW *\fIwin\fP); |
| 61 |
.PP |
| 62 |
\fBint getparx(const WINDOW *\fIwin\fP); |
| 63 |
\fBint getpary(const WINDOW *\fIwin\fP); |
| 64 |
.fi |
| 65 |
.SH DESCRIPTION |
| 66 |
These legacy functions are simpler to use |
| 67 |
than the X/Open \fIcurses\fP functions: |
| 68 |
.bP |
| 69 |
The \fB\%getattrs\fP function returns the same attribute data |
| 70 |
as \fB\%wattr_get\fP. |
| 71 |
.IP |
| 72 |
However, \fB\%getattrs\fP returns an integer (actually a \fB\%chtype\fP), |
| 73 |
while \fB\%wattr_get\fP returns the current color pair in a separate parameter. |
| 74 |
In the wide-character library configuration, |
| 75 |
color pairs may not fit into a \fB\%chtype\fP, |
| 76 |
so \fB\%wattr_get\fP is the only way to obtain the color information. |
| 77 |
.IP |
| 78 |
Because \fB\%getattrs\fP returns the attributes in a single parameter, |
| 79 |
it would not be possible for an application to distinguish that from |
| 80 |
\fBERR\fP (a \fI-1\fP). |
| 81 |
If the window parameter is null, \fB\%getattrs\fP |
| 82 |
returns \fB\%A_NORMAL\fP (zero). |
| 83 |
.bP |
| 84 |
The \fB\%getbegy\fP and \fB\%getbegx\fP functions return the same |
| 85 |
data as \fB\%getbegyx\fP. |
| 86 |
.bP |
| 87 |
The \fB\%getcury\fP and \fB\%getcurx\fP functions return the same |
| 88 |
data as \fB\%getyx\fP. |
| 89 |
.bP |
| 90 |
The \fB\%getmaxy\fP and \fB\%getmaxx\fP functions return the same |
| 91 |
data as \fB\%getmaxyx\fP. |
| 92 |
.bP |
| 93 |
The \fB\%getpary\fP and \fB\%getparx\fP functions return the same |
| 94 |
data as \fB\%getparyx\fP. |
| 95 |
.SH RETURN VALUE |
| 96 |
Except as noted, |
| 97 |
these functions return an integer, |
| 98 |
or \fBERR\fP if the window parameter is null. |
| 99 |
.SH PORTABILITY |
| 100 |
These functions were supported on Version 7, BSD or System V implementations. |
| 101 |
None of those implementations checked the window parameter. |
| 102 |
.PP |
| 103 |
The \fB\%getattrs\fP function and macro are defined to return a (signed) integer |
| 104 |
for compatibility with those implementations |
| 105 |
although an unsigned type would have been more appropriate. |
| 106 |
.SH SEE ALSO |
| 107 |
\fB\%ncurses\fP(3NCURSES), |
| 108 |
\fB\%getyx\fP(3NCURSES), |
| 109 |
\fB\%opaque\fP(3NCURSES) |