[BACK]Return to curses_cursor.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcurses

File: [cvs.NetBSD.org] / src / lib / libcurses / curses_cursor.3 (download)

Revision 1.7, Wed Feb 24 13:02:13 2010 UTC (14 years, 1 month ago) by drochner
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, localcount-20160914, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver
Branch point for: pgoyette-localcount
Changes since 1.6: +13 -3 lines

document wsyncup/wsyncdown/wcursyncup

.\"	$NetBSD: curses_cursor.3,v 1.7 2010/02/24 13:02:13 drochner Exp $
.\"
.\" Copyright (c) 2002
.\"	Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
.\"
.\" This code is donated to the NetBSD Foundation by the Author.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. The name of the Author may not be used to endorse or promote
.\"    products derived from this software without specific prior written
.\"    permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"
.Dd February 23, 2010
.Dt CURSES 3
.Os
.Sh NAME
.Nm curses_cursor ,
.Nm getcury ,
.Nm getcurx ,
.Nm getyx ,
.Nm getbegy ,
.Nm getbegx ,
.Nm getbegyx ,
.Nm getmaxy ,
.Nm getmaxx ,
.Nm getmaxyx ,
.Nm getpary ,
.Nm getparx ,
.Nm getparyx ,
.Nm move ,
.Nm wmove ,
.Nm mvcur ,
.Nm wcursyncup
.Nd curses cursor and window location and positioning routines
.Sh LIBRARY
.Lb libcurses
.Sh SYNOPSIS
.In curses.h
.Ft int
.Fn getcury "WINDOW *win"
.Ft int
.Fn getcurx "WINDOW *win"
.Ft void
.Fn getyx "WINDOW *win" "int y" "int x"
.Ft int
.Fn getbegy "WINDOW *win"
.Ft int
.Fn getbegx "WINDOW *win"
.Ft void
.Fn getbegyx "WINDOW *win" "int y" "int x"
.Ft int
.Fn getmaxy "WINDOW *win"
.Ft int
.Fn getmaxx "WINDOW *win"
.Ft void
.Fn getmaxyx "WINDOW *win" "int y" "int x"
.Ft int
.Fn getpary "WINDOW *win"
.Ft int
.Fn getparx "WINDOW *win"
.Ft void
.Fn getparyx "WINDOW *win" "int y" "int x"
.Ft int
.Fn move "int y" "int x"
.Ft int
.Fn wmove "WINDOW *win" "int y" "int x"
.Ft int
.Fn mvcur "int oldy" "int oldx" "int y" "int x"
.Ft void
.Fn wcursyncup "WINDOW *win"
.Sh DESCRIPTION
These functions and macros locate and position cursors and windows.
.Pp
The
.Fn getcury
and
.Fn getcurx
functions get the current row and column positions, respectively, of the cursor in
the window
.Fa win .
The
.Fn getyx
macro sets the values of
.Fa y
and
.Fa x
to the current row and column positions of the cursor in the window
.Fa win .
.Pp
The origin row and columns of a window
.Fa win
can be
determined by calling the
.Fn getbegy
and
.Fn getbegx
functions, respectively, and the maximum row and column for the window can be
found by calling the functions
.Fn getmaxy
and
.Fn getmaxx ,
respectively.
The
.Fn getbegyx
and
.Fn getmaxyx
macros set the values of
.Fa y
and
.Fa x
to the origin and maximum row and column positions, respectively, for the window
.Fa win .
.Pp
The
.Fn getpary
and
.Fn getparx
functions return the row and column position of the given subwindow relative to
the window's parent.
The macro
.Fn getparyx
sets the values of
.Fa y
and
.Fa x
to the origin of the subwindow relative to the window's parent.
.Pp
The
.Fn move
function positions the cursor on the current window at the position given by
.Fa y ,
.Fa x .
The cursor position is not changed on the screen until the next
.Fn refresh .
.Pp
The
.Fn wmove
function is the same as the
.Fn move
function, excepting that the cursor is moved in the window specified by
.Fa win .
.Pp
The function
.Fn mvcur
moves the cursor to
.Fa y ,
.Fa x
on the screen.
The arguments
.Fa oldy ,
.Fa oldx
define the previous cursor position for terminals that do not support
absolute cursor motions.
The curses library may optimise the cursor motion based on these values.
If the
.Fn mvcur
succeeds then the curses internal structures are updated with the new
position of the cursor.
If the destination arguments for
.Fn mvcur
exceed the terminal bounds an error will be returned and the cursor
position will be unchanged.
.Pp
The
.Fn wcursyncup
function sets the cursor positions of all ancestors of
.Fa win
to that of
.Fa win .
.Sh RETURN VALUES
Functions returning pointers will return
.Dv NULL
if an error is detected.
The functions that return an int will return one of the following
values:
.Pp
.Bl -tag -width ERR -compact
.It Er OK
The function completed successfully.
.It Er ERR
An error occurred in the function.
.El
.Sh SEE ALSO
.Xr curses_refresh 3
.Sh STANDARDS
The
.Nx
Curses library complies with the X/Open Curses specification, part of
the Single Unix Specification.
The
.Fn getbegx ,
.Fn getbegy ,
.Fn getcurx ,
.Fn getcury ,
.Fn getmaxx ,
.Fn getmaxy ,
.Fn getparx ,
and
.Fn getpary
functions are extensions.
.Sh HISTORY
The Curses package appeared in
.Bx 4.0 .