]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_legacy.3x
ncurses 6.2 - patch 20210807
[ncurses.git] / man / curs_legacy.3x
1 .\"***************************************************************************
2 .\" Copyright 2019,2020 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.12 2020/10/18 00:16:04 tom Exp $
31 .de bP
32 .ie n  .IP \(bu 4
33 .el    .IP \(bu 2
34 ..
35 .TH curs_legacy 3X ""
36 .SH NAME
37 curs_legacy \- get \fBcurses\fP cursor and window coordinates, attributes
38 .SH SYNOPSIS
39 \fB#include <curses.h>\fP
40 .sp
41 \fBint getattrs(const WINDOW *\fP\fIwin\fP\fB);\fP
42 .sp
43 \fBint getbegx(const WINDOW *\fP\fIwin\fP\fB);\fP
44 .br
45 \fBint getbegy(const WINDOW *\fP\fIwin\fP\fB);\fP
46 .sp
47 \fBint getcurx(const WINDOW *\fP\fIwin\fP\fB);\fP
48 .br
49 \fBint getcury(const WINDOW *\fP\fIwin\fP\fB);\fP
50 .sp
51 \fBint getmaxx(const WINDOW *\fP\fIwin\fP\fB);\fP
52 .br
53 \fBint getmaxy(const WINDOW *\fP\fIwin\fP\fB);\fP
54 .sp
55 \fBint getparx(const WINDOW *\fP\fIwin\fP\fB);\fP
56 .br
57 \fBint getpary(const WINDOW *\fP\fIwin\fP\fB);\fP
58 .br
59 .SH DESCRIPTION
60 These legacy functions are simpler to use than the X/Open Curses functions:
61 .bP
62 The \fBgetattrs\fP function returns the same attribute data as \fBwattr_get\fP.
63 .IP
64 However, \fBgetattrs\fP returns an integer (actually a \fBchtype\fP),
65 while \fBwattr_get\fP returns the current color pair in a separate parameter.
66 In the wide-character library configuration,
67 color pairs may not fit into a \fBchtype\fP,
68 so \fBwattr_get\fP is the only way to obtain the color information.
69 .IP
70 Because \fBgetattrs\fP returns the attributes in a single parameter,
71 it would not be possible for an application to distinguish that from
72 \fBERR\fP (a \fI-1\fP).
73 If the window parameter is null, \fBgetattrs\fP returns \fBA_NORMAL\fP (zero).
74 .bP
75 The \fBgetbegy\fP and \fBgetbegx\fP functions return the same
76 data as \fBgetbegyx\fP.
77 .bP
78 The \fBgetcury\fP and \fBgetcurx\fP functions return the same
79 data as \fBgetyx\fP.
80 .bP
81 The \fBgetmaxy\fP and \fBgetmaxx\fP functions return the same
82 data as \fBgetmaxyx\fP.
83 .bP
84 The \fBgetpary\fP and \fBgetparx\fP functions return the same
85 data as \fBgetparyx\fP.
86 .SH RETURN VALUE
87 Except as noted,
88 these functions return an integer,
89 or \fBERR\fP if the window parameter is null.
90 .SH NOTES
91 All of these interfaces are provided as macros and functions.
92 The macros are suppressed (and only the functions provided)
93 when \fBNCURSES_OPAQUE\fP is defined.
94 The standard forms such as \fBgetyx\fP must be implemented as macros,
95 and (in this implementation) are defined in terms of the functions
96 described here,
97 to avoid reliance on internal details of the WINDOW structure.
98 .SH PORTABILITY
99 These functions were supported on Version 7, BSD or System V implementations.
100 None of those implementations checked the window parameter.
101 .PP
102 The \fBgetattrs\fP function and macro are defined to return a (signed) integer
103 for compatibility with those implementations
104 although an unsigned type would have been more appropriate.
105 .SH SEE ALSO
106 \fBcurses\fP(3X),
107 \fBcurs_getyx\fP(3X),
108 \fBcurs_opaque\fP(3X)