xref: /minix3/lib/libcurses/curses_cursor.3 (revision 51ffecc181005cb45a40108612ee28d1daaeeb86)
1*51ffecc1SBen Gras.\"	$NetBSD: curses_cursor.3,v 1.7 2010/02/24 13:02:13 drochner Exp $
2*51ffecc1SBen Gras.\"
3*51ffecc1SBen Gras.\" Copyright (c) 2002
4*51ffecc1SBen Gras.\"	Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
5*51ffecc1SBen Gras.\"
6*51ffecc1SBen Gras.\" This code is donated to the NetBSD Foundation by the Author.
7*51ffecc1SBen Gras.\"
8*51ffecc1SBen Gras.\" Redistribution and use in source and binary forms, with or without
9*51ffecc1SBen Gras.\" modification, are permitted provided that the following conditions
10*51ffecc1SBen Gras.\" are met:
11*51ffecc1SBen Gras.\" 1. Redistributions of source code must retain the above copyright
12*51ffecc1SBen Gras.\"    notice, this list of conditions and the following disclaimer.
13*51ffecc1SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
14*51ffecc1SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
15*51ffecc1SBen Gras.\"    documentation and/or other materials provided with the distribution.
16*51ffecc1SBen Gras.\" 3. The name of the Author may not be used to endorse or promote
17*51ffecc1SBen Gras.\"    products derived from this software without specific prior written
18*51ffecc1SBen Gras.\"    permission.
19*51ffecc1SBen Gras.\"
20*51ffecc1SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21*51ffecc1SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*51ffecc1SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*51ffecc1SBen Gras.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
24*51ffecc1SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25*51ffecc1SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26*51ffecc1SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27*51ffecc1SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28*51ffecc1SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29*51ffecc1SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30*51ffecc1SBen Gras.\" SUCH DAMAGE.
31*51ffecc1SBen Gras.\"
32*51ffecc1SBen Gras.\"
33*51ffecc1SBen Gras.Dd February 23, 2010
34*51ffecc1SBen Gras.Dt CURSES 3
35*51ffecc1SBen Gras.Os
36*51ffecc1SBen Gras.Sh NAME
37*51ffecc1SBen Gras.Nm curses_cursor ,
38*51ffecc1SBen Gras.Nm getcury ,
39*51ffecc1SBen Gras.Nm getcurx ,
40*51ffecc1SBen Gras.Nm getyx ,
41*51ffecc1SBen Gras.Nm getbegy ,
42*51ffecc1SBen Gras.Nm getbegx ,
43*51ffecc1SBen Gras.Nm getbegyx ,
44*51ffecc1SBen Gras.Nm getmaxy ,
45*51ffecc1SBen Gras.Nm getmaxx ,
46*51ffecc1SBen Gras.Nm getmaxyx ,
47*51ffecc1SBen Gras.Nm getpary ,
48*51ffecc1SBen Gras.Nm getparx ,
49*51ffecc1SBen Gras.Nm getparyx ,
50*51ffecc1SBen Gras.Nm move ,
51*51ffecc1SBen Gras.Nm wmove ,
52*51ffecc1SBen Gras.Nm mvcur ,
53*51ffecc1SBen Gras.Nm wcursyncup
54*51ffecc1SBen Gras.Nd curses cursor and window location and positioning routines
55*51ffecc1SBen Gras.Sh LIBRARY
56*51ffecc1SBen Gras.Lb libcurses
57*51ffecc1SBen Gras.Sh SYNOPSIS
58*51ffecc1SBen Gras.In curses.h
59*51ffecc1SBen Gras.Ft int
60*51ffecc1SBen Gras.Fn getcury "WINDOW *win"
61*51ffecc1SBen Gras.Ft int
62*51ffecc1SBen Gras.Fn getcurx "WINDOW *win"
63*51ffecc1SBen Gras.Ft void
64*51ffecc1SBen Gras.Fn getyx "WINDOW *win" "int y" "int x"
65*51ffecc1SBen Gras.Ft int
66*51ffecc1SBen Gras.Fn getbegy "WINDOW *win"
67*51ffecc1SBen Gras.Ft int
68*51ffecc1SBen Gras.Fn getbegx "WINDOW *win"
69*51ffecc1SBen Gras.Ft void
70*51ffecc1SBen Gras.Fn getbegyx "WINDOW *win" "int y" "int x"
71*51ffecc1SBen Gras.Ft int
72*51ffecc1SBen Gras.Fn getmaxy "WINDOW *win"
73*51ffecc1SBen Gras.Ft int
74*51ffecc1SBen Gras.Fn getmaxx "WINDOW *win"
75*51ffecc1SBen Gras.Ft void
76*51ffecc1SBen Gras.Fn getmaxyx "WINDOW *win" "int y" "int x"
77*51ffecc1SBen Gras.Ft int
78*51ffecc1SBen Gras.Fn getpary "WINDOW *win"
79*51ffecc1SBen Gras.Ft int
80*51ffecc1SBen Gras.Fn getparx "WINDOW *win"
81*51ffecc1SBen Gras.Ft void
82*51ffecc1SBen Gras.Fn getparyx "WINDOW *win" "int y" "int x"
83*51ffecc1SBen Gras.Ft int
84*51ffecc1SBen Gras.Fn move "int y" "int x"
85*51ffecc1SBen Gras.Ft int
86*51ffecc1SBen Gras.Fn wmove "WINDOW *win" "int y" "int x"
87*51ffecc1SBen Gras.Ft int
88*51ffecc1SBen Gras.Fn mvcur "int oldy" "int oldx" "int y" "int x"
89*51ffecc1SBen Gras.Ft void
90*51ffecc1SBen Gras.Fn wcursyncup "WINDOW *win"
91*51ffecc1SBen Gras.Sh DESCRIPTION
92*51ffecc1SBen GrasThese functions and macros locate and position cursors and windows.
93*51ffecc1SBen Gras.Pp
94*51ffecc1SBen GrasThe
95*51ffecc1SBen Gras.Fn getcury
96*51ffecc1SBen Grasand
97*51ffecc1SBen Gras.Fn getcurx
98*51ffecc1SBen Grasfunctions get the current row and column positions, respectively, of the cursor in
99*51ffecc1SBen Grasthe window
100*51ffecc1SBen Gras.Fa win .
101*51ffecc1SBen GrasThe
102*51ffecc1SBen Gras.Fn getyx
103*51ffecc1SBen Grasmacro sets the values of
104*51ffecc1SBen Gras.Fa y
105*51ffecc1SBen Grasand
106*51ffecc1SBen Gras.Fa x
107*51ffecc1SBen Grasto the current row and column positions of the cursor in the window
108*51ffecc1SBen Gras.Fa win .
109*51ffecc1SBen Gras.Pp
110*51ffecc1SBen GrasThe origin row and columns of a window
111*51ffecc1SBen Gras.Fa win
112*51ffecc1SBen Grascan be
113*51ffecc1SBen Grasdetermined by calling the
114*51ffecc1SBen Gras.Fn getbegy
115*51ffecc1SBen Grasand
116*51ffecc1SBen Gras.Fn getbegx
117*51ffecc1SBen Grasfunctions, respectively, and the maximum row and column for the window can be
118*51ffecc1SBen Grasfound by calling the functions
119*51ffecc1SBen Gras.Fn getmaxy
120*51ffecc1SBen Grasand
121*51ffecc1SBen Gras.Fn getmaxx ,
122*51ffecc1SBen Grasrespectively.
123*51ffecc1SBen GrasThe
124*51ffecc1SBen Gras.Fn getbegyx
125*51ffecc1SBen Grasand
126*51ffecc1SBen Gras.Fn getmaxyx
127*51ffecc1SBen Grasmacros set the values of
128*51ffecc1SBen Gras.Fa y
129*51ffecc1SBen Grasand
130*51ffecc1SBen Gras.Fa x
131*51ffecc1SBen Grasto the origin and maximum row and column positions, respectively, for the window
132*51ffecc1SBen Gras.Fa win .
133*51ffecc1SBen Gras.Pp
134*51ffecc1SBen GrasThe
135*51ffecc1SBen Gras.Fn getpary
136*51ffecc1SBen Grasand
137*51ffecc1SBen Gras.Fn getparx
138*51ffecc1SBen Grasfunctions return the row and column position of the given subwindow relative to
139*51ffecc1SBen Grasthe window's parent.
140*51ffecc1SBen GrasThe macro
141*51ffecc1SBen Gras.Fn getparyx
142*51ffecc1SBen Grassets the values of
143*51ffecc1SBen Gras.Fa y
144*51ffecc1SBen Grasand
145*51ffecc1SBen Gras.Fa x
146*51ffecc1SBen Grasto the origin of the subwindow relative to the window's parent.
147*51ffecc1SBen Gras.Pp
148*51ffecc1SBen GrasThe
149*51ffecc1SBen Gras.Fn move
150*51ffecc1SBen Grasfunction positions the cursor on the current window at the position given by
151*51ffecc1SBen Gras.Fa y ,
152*51ffecc1SBen Gras.Fa x .
153*51ffecc1SBen GrasThe cursor position is not changed on the screen until the next
154*51ffecc1SBen Gras.Fn refresh .
155*51ffecc1SBen Gras.Pp
156*51ffecc1SBen GrasThe
157*51ffecc1SBen Gras.Fn wmove
158*51ffecc1SBen Grasfunction is the same as the
159*51ffecc1SBen Gras.Fn move
160*51ffecc1SBen Grasfunction, excepting that the cursor is moved in the window specified by
161*51ffecc1SBen Gras.Fa win .
162*51ffecc1SBen Gras.Pp
163*51ffecc1SBen GrasThe function
164*51ffecc1SBen Gras.Fn mvcur
165*51ffecc1SBen Grasmoves the cursor to
166*51ffecc1SBen Gras.Fa y ,
167*51ffecc1SBen Gras.Fa x
168*51ffecc1SBen Grason the screen.
169*51ffecc1SBen GrasThe arguments
170*51ffecc1SBen Gras.Fa oldy ,
171*51ffecc1SBen Gras.Fa oldx
172*51ffecc1SBen Grasdefine the previous cursor position for terminals that do not support
173*51ffecc1SBen Grasabsolute cursor motions.
174*51ffecc1SBen GrasThe curses library may optimise the cursor motion based on these values.
175*51ffecc1SBen GrasIf the
176*51ffecc1SBen Gras.Fn mvcur
177*51ffecc1SBen Grassucceeds then the curses internal structures are updated with the new
178*51ffecc1SBen Grasposition of the cursor.
179*51ffecc1SBen GrasIf the destination arguments for
180*51ffecc1SBen Gras.Fn mvcur
181*51ffecc1SBen Grasexceed the terminal bounds an error will be returned and the cursor
182*51ffecc1SBen Grasposition will be unchanged.
183*51ffecc1SBen Gras.Pp
184*51ffecc1SBen GrasThe
185*51ffecc1SBen Gras.Fn wcursyncup
186*51ffecc1SBen Grasfunction sets the cursor positions of all ancestors of
187*51ffecc1SBen Gras.Fa win
188*51ffecc1SBen Grasto that of
189*51ffecc1SBen Gras.Fa win .
190*51ffecc1SBen Gras.Sh RETURN VALUES
191*51ffecc1SBen GrasFunctions returning pointers will return
192*51ffecc1SBen Gras.Dv NULL
193*51ffecc1SBen Grasif an error is detected.
194*51ffecc1SBen GrasThe functions that return an int will return one of the following
195*51ffecc1SBen Grasvalues:
196*51ffecc1SBen Gras.Pp
197*51ffecc1SBen Gras.Bl -tag -width ERR -compact
198*51ffecc1SBen Gras.It Er OK
199*51ffecc1SBen GrasThe function completed successfully.
200*51ffecc1SBen Gras.It Er ERR
201*51ffecc1SBen GrasAn error occurred in the function.
202*51ffecc1SBen Gras.El
203*51ffecc1SBen Gras.Sh SEE ALSO
204*51ffecc1SBen Gras.Xr curses_refresh 3
205*51ffecc1SBen Gras.Sh STANDARDS
206*51ffecc1SBen GrasThe
207*51ffecc1SBen Gras.Nx
208*51ffecc1SBen GrasCurses library complies with the X/Open Curses specification, part of
209*51ffecc1SBen Grasthe Single Unix Specification.
210*51ffecc1SBen GrasThe
211*51ffecc1SBen Gras.Fn getbegx ,
212*51ffecc1SBen Gras.Fn getbegy ,
213*51ffecc1SBen Gras.Fn getcurx ,
214*51ffecc1SBen Gras.Fn getcury ,
215*51ffecc1SBen Gras.Fn getmaxx ,
216*51ffecc1SBen Gras.Fn getmaxy ,
217*51ffecc1SBen Gras.Fn getparx ,
218*51ffecc1SBen Grasand
219*51ffecc1SBen Gras.Fn getpary
220*51ffecc1SBen Grasfunctions are extensions.
221*51ffecc1SBen Gras.Sh HISTORY
222*51ffecc1SBen GrasThe Curses package appeared in
223*51ffecc1SBen Gras.Bx 4.0 .
224