/* PDCurses */12#include <curspriv.h>34/*man-start**************************************************************56getyx7-----89### Synopsis1011void getyx(WINDOW *win, int y, int x);12void getparyx(WINDOW *win, int y, int x);13void getbegyx(WINDOW *win, int y, int x);14void getmaxyx(WINDOW *win, int y, int x);1516void getsyx(int y, int x);17void setsyx(int y, int x);1819int getbegy(WINDOW *win);20int getbegx(WINDOW *win);21int getcury(WINDOW *win);22int getcurx(WINDOW *win);23int getpary(WINDOW *win);24int getparx(WINDOW *win);25int getmaxy(WINDOW *win);26int getmaxx(WINDOW *win);2728### Description2930The getyx() macro (defined in curses.h -- the prototypes here are31merely illustrative) puts the current cursor position of the32specified window into y and x. getbegyx() and getmaxyx() return the33starting coordinates and size of the specified window, respectively.34getparyx() returns the starting coordinates of the parent's window,35if the specified window is a subwindow; otherwise it sets y and x to36-1. These are all macros.3738getsyx() gets the coordinates of the virtual screen cursor, and39stores them in y and x. If leaveok() is TRUE, it returns -1, -1. If40lines have been removed with ripoffline(), then getsyx() includes41these lines in its count; so, the returned y and x values should only42be used with setsyx().4344setsyx() sets the virtual screen cursor to the y, x coordinates. If45either y or x is -1, leaveok() is set TRUE, else it's set FALSE.4647getsyx() and setsyx() are meant to be used by a library routine that48manipulates curses windows without altering the position of the49cursor. Note that getsyx() is defined only as a macro.5051getbegy(), getbegx(), getcurx(), getcury(), getmaxy(), getmaxx(),52getpary(), and getparx() return the appropriate coordinate or size53values, or ERR in the case of a NULL window.5455### Portability56X/Open ncurses NetBSD57getyx Y Y Y58getparyx Y Y Y59getbegyx Y Y Y60getmaxyx Y Y Y61getsyx - Y Y62setsyx - Y Y63getbegy - Y Y64getbegx - Y Y65getcury - Y Y66getcurx - Y Y67getpary - Y Y68getparx - Y Y69getmaxy - Y Y70getmaxx - Y Y7172**man-end****************************************************************/7374int getbegy(WINDOW *win)75{76PDC_LOG(("getbegy() - called\n"));7778return win ? win->_begy : ERR;79}8081int getbegx(WINDOW *win)82{83PDC_LOG(("getbegx() - called\n"));8485return win ? win->_begx : ERR;86}8788int getcury(WINDOW *win)89{90PDC_LOG(("getcury() - called\n"));9192return win ? win->_cury : ERR;93}9495int getcurx(WINDOW *win)96{97PDC_LOG(("getcurx() - called\n"));9899return win ? win->_curx : ERR;100}101102int getpary(WINDOW *win)103{104PDC_LOG(("getpary() - called\n"));105106return win ? win->_pary : ERR;107}108109int getparx(WINDOW *win)110{111PDC_LOG(("getparx() - called\n"));112113return win ? win->_parx : ERR;114}115116int getmaxy(WINDOW *win)117{118PDC_LOG(("getmaxy() - called\n"));119120return win ? win->_maxy : ERR;121}122123int getmaxx(WINDOW *win)124{125PDC_LOG(("getmaxx() - called\n"));126127return win ? win->_maxx : ERR;128}129130void setsyx(int y, int x)131{132PDC_LOG(("setsyx() - called\n"));133134if (curscr)135{136curscr->_leaveit = y == -1 || x == -1;137138if (!curscr->_leaveit)139wmove(curscr, y, x);140}141}142143144