1 .\"***************************************************************************
2 .\" Copyright 2019-2023,2024 Thomas E. Dickey *
3 .\" Copyright 2007-2015,2017 Free Software Foundation, Inc. *
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: *
13 .\" The above copyright notice and this permission notice shall be included *
14 .\" in all copies or substantial portions of the Software. *
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. *
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 *
28 .\"***************************************************************************
30 .\" $Id: curs_legacy.3x,v 1.34 2024/05/25 20:15:31 tom Exp $
31 .TH curs_legacy 3X 2024-05-25 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
57 get \fIcurses\fR cursor and window coordinates or attributes (legacy)
60 \fB#include <curses.h>
62 \fBint getattrs(const WINDOW *\fIwin\fP);
64 \fBint getbegx(const WINDOW *\fIwin\fP);
65 \fBint getbegy(const WINDOW *\fIwin\fP);
67 \fBint getcurx(const WINDOW *\fIwin\fP);
68 \fBint getcury(const WINDOW *\fIwin\fP);
70 \fBint getmaxx(const WINDOW *\fIwin\fP);
71 \fBint getmaxy(const WINDOW *\fIwin\fP);
73 \fBint getparx(const WINDOW *\fIwin\fP);
74 \fBint getpary(const WINDOW *\fIwin\fP);
77 These legacy functions are simpler to use
78 than the X/Open \fIcurses\fP functions:
80 The \fB\%getattrs\fP function returns the same attribute data
83 However, \fB\%getattrs\fP returns an integer (actually a \fB\%chtype\fP),
84 while \fB\%wattr_get\fP returns the current color pair in a separate parameter.
85 In the wide-character library configuration,
86 color pairs may not fit into a \fB\%chtype\fP,
87 so \fB\%wattr_get\fP is the only way to obtain the color information.
89 Because \fB\%getattrs\fP returns the attributes in a single parameter,
90 it would not be possible for an application to distinguish that from
91 \fBERR\fP (a \fI-1\fP).
92 If the window parameter is null, \fB\%getattrs\fP
93 returns \fB\%A_NORMAL\fP (zero).
95 The \fB\%getbegy\fP and \fB\%getbegx\fP functions return the same
96 data as \fB\%getbegyx\fP.
98 The \fB\%getcury\fP and \fB\%getcurx\fP functions return the same
99 data as \fB\%getyx\fP.
101 The \fB\%getmaxy\fP and \fB\%getmaxx\fP functions return the same
102 data as \fB\%getmaxyx\fP.
104 The \fB\%getpary\fP and \fB\%getparx\fP functions return the same
105 data as \fB\%getparyx\fP.
108 these functions return an integer,
109 or \fBERR\fP if the window parameter is null.
111 These functions were supported on Version 7, BSD or System V implementations.
112 None of those implementations checked the window parameter.
114 The \fB\%getattrs\fP function and macro are defined to return a (signed) integer
115 for compatibility with those implementations
116 although an unsigned type would have been more appropriate.
119 \fB\%curs_getyx\fP(3X),
120 \fB\%curs_opaque\fP(3X)