blob: 2581253d7c7815412b2a0335aef56a7ae7d95457 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
2.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
3.\" *
4.\" Permission is hereby granted, free of charge, to any person obtaining a *
5.\" copy of this software and associated documentation files (the *
6.\" "Software"), to deal in the Software without restriction, including *
7.\" without limitation the rights to use, copy, modify, merge, publish, *
8.\" distribute, distribute with modifications, sublicense, and/or sell *
9.\" copies of the Software, and to permit persons to whom the Software is *
10.\" furnished to do so, subject to the following conditions: *
11.\" *
12.\" The above copyright notice and this permission notice shall be included *
13.\" in all copies or substantial portions of the Software. *
14.\" *
15.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
22.\" *
23.\" Except as contained in this notice, the name(s) of the above copyright *
24.\" holders shall not be used in advertising or otherwise to promote the *
25.\" sale, use or other dealings in this Software without prior written *
26.\" authorization. *
27.\"***************************************************************************
28.\"
29.\" $Id: curs_getyx.3x,v 1.16 2007/05/12 16:34:49 tom Exp $
30.TH curs_getyx 3X ""
31.SH NAME
32\fBgetyx\fR,
33\fBgetparyx\fR,
34\fBgetbegyx\fR,
35\fBgetmaxyx\fR - get \fBcurses\fR cursor and window coordinates
36.SH SYNOPSIS
37\fB#include <curses.h>\fR
38.sp
39\fBvoid getyx(WINDOW *win, int y, int x);\fR
40.br
41\fBvoid getparyx(WINDOW *win, int y, int x);\fR
42.br
43\fBvoid getbegyx(WINDOW *win, int y, int x);\fR
44.br
45\fBvoid getmaxyx(WINDOW *win, int y, int x);\fR
46.br
47.SH DESCRIPTION
48The \fBgetyx\fR macro places the current cursor position of the given window in
49the two integer variables \fIy\fR and \fIx\fR.
50.PP
51If \fIwin\fR is a subwindow, the \fBgetparyx\fR macro places the beginning
52coordinates of the subwindow relative to the parent window into two integer
53variables \fIy\fR and \fIx\fR.
54Otherwise, \fB-1\fR is placed into \fIy\fR and \fIx\fR.
55.PP
56Like \fBgetyx\fR, the \fBgetbegyx\fR and \fBgetmaxyx\fR macros store
57the current beginning coordinates and size of the specified window.
58.SH RETURN VALUE
59The return values of these macros are undefined (i.e.,
60they should not be used as the right-hand side of assignment statements).
61.SH NOTES
62All of these interfaces are macros.
63A "\fB&\fR" is not necessary before the variables \fIy\fR and \fIx\fR.
64.SH PORTABILITY
65The
66\fBgetyx\fR,
67\fBgetparyx\fR,
68\fBgetbegyx\fR and
69\fBgetmaxyx\fR
70macros are described in the XSI Curses standard, Issue 4.
71.PP
72This implementation also provides functions
73\fBgetbegx\fR,
74\fBgetbegy\fR,
75\fBgetcurx\fR,
76\fBgetcury\fR,
77\fBgetmaxx\fR,
78\fBgetmaxy\fR,
79\fBgetparx\fR and
80\fBgetpary\fR
81for compatibility with older versions of curses.
82.PP
83Although X/Open Curses does not address this,
84many implementations provide members of the WINDOW structure
85containing values corresponding to these macros.
86For best portability, do not rely on using the data in WINDOW,
87since some implementations make WINDOW opaque (do not allow
88direct use of its members).
89.PP
90Besides the problem of opaque structures,
91the data stored in like-named members may not have like-values in
92different implementations.
93For example, the WINDOW._maxx and WINDOW._maxy values in ncurses
94have (at least since release 1.8.1) differed by one from some
95other implementations.
96The difference is hidden by means of the macro \fBgetmaxyx\fP.
97.SH SEE ALSO
98\fBcurses\fR(3X),
99\fBcurs_legacy\fR(3X),
100\fBcurs_opaque\fR(3X)
101.\"#
102.\"# The following sets edit modes for GNU EMACS
103.\"# Local Variables:
104.\"# mode:nroff
105.\"# fill-column:79
106.\"# End: