1curs_legacy(3X) curs_legacy(3X)
2
3
4
6 curs_legacy - get curses cursor and window coordinates, attributes
7
9 #include <curses.h>
10
11 int getattrs(const WINDOW *win);
12 int getbegx(const WINDOW *win);
13 int getbegy(const WINDOW *win);
14 int getcurx(const WINDOW *win);
15 int getcury(const WINDOW *win);
16 int getmaxx(const WINDOW *win);
17 int getmaxy(const WINDOW *win);
18 int getparx(const WINDOW *win);
19 int getpary(const WINDOW *win);
20
22 These legacy functions are simpler to use than the X/Open Curses func‐
23 tions:
24
25 · The getattrs function returns the same attribute data as wattr_get.
26
27 However, getattrs returns an integer (actually a chtype), while
28 wattr_get returns the current color pair in a separate parameter.
29 In the wide-character library configuration, color pairs may not
30 fit into a chtype, so wattr_get is the only way to obtain the color
31 information.
32
33 Because getattrs returns the attributes in a single parameter, it
34 would not be possible for an application to distinguish that from
35 ERR (a -1). If the window parameter is null, getattrs returns
36 A_NORMAL (zero).
37
38 · The getbegy and getbegx functions return the same data as getbegyx.
39
40 · The getcury and getcurx functions return the same data as getyx.
41
42 · The getmaxy and getmaxx functions return the same data as getmaxyx.
43
44 · The getpary and getparx functions return the same data as getparyx.
45
47 Except as noted, these functions return an integer, or ERR if the win‐
48 dow parameter is null.
49
51 All of these interfaces are provided as macros and functions. The
52 macros are suppressed (and only the functions provided) when
53 NCURSES_OPAQUE is defined. The standard forms such as getyx must be
54 implemented as macros, and (in this implementation) are defined in
55 terms of the functions described here, to avoid reliance on internal
56 details of the WINDOW structure.
57
59 These functions were supported on Version 7, BSD or System V implemen‐
60 tations. None of those implementations checked the window parameter.
61
62 The getattrs function and macro are defined to return a (signed) inte‐
63 ger for compatibility with those implementations although an unsigned
64 type would have been more appropriate.
65
67 curses(3X), curs_getyx(3X), curs_opaque(3X)
68
69
70
71 curs_legacy(3X)