diff options
Diffstat (limited to 'scripts/kconfig/libcurses/move.c')
| -rw-r--r-- | scripts/kconfig/libcurses/move.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/scripts/kconfig/libcurses/move.c b/scripts/kconfig/libcurses/move.c new file mode 100644 index 000000000..38db1d19a --- /dev/null +++ b/scripts/kconfig/libcurses/move.c | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | /* PDCurses */ | ||
| 2 | |||
| 3 | #include "curspriv.h" | ||
| 4 | |||
| 5 | /*man-start************************************************************** | ||
| 6 | |||
| 7 | move | ||
| 8 | ---- | ||
| 9 | |||
| 10 | ### Synopsis | ||
| 11 | |||
| 12 | int move(int y, int x); | ||
| 13 | int mvcur(int oldrow, int oldcol, int newrow, int newcol); | ||
| 14 | int wmove(WINDOW *win, int y, int x); | ||
| 15 | |||
| 16 | ### Description | ||
| 17 | |||
| 18 | move() and wmove() move the cursor associated with the window to the | ||
| 19 | given location. This does not move the physical cursor of the | ||
| 20 | terminal until refresh() is called. The position specified is | ||
| 21 | relative to the upper left corner of the window, which is (0,0). | ||
| 22 | |||
| 23 | mvcur() moves the physical cursor without updating any window cursor | ||
| 24 | positions. | ||
| 25 | |||
| 26 | ### Return Value | ||
| 27 | |||
| 28 | All functions return OK on success and ERR on error. | ||
| 29 | |||
| 30 | ### Portability | ||
| 31 | |||
| 32 | Function | X/Open | ncurses | NetBSD | ||
| 33 | :---------------------|:------:|:-------:|:------: | ||
| 34 | move | Y | Y | Y | ||
| 35 | mvcur | Y | Y | Y | ||
| 36 | wmove | Y | Y | Y | ||
| 37 | |||
| 38 | **man-end****************************************************************/ | ||
| 39 | |||
| 40 | int move(int y, int x) | ||
| 41 | { | ||
| 42 | PDC_LOG(("move() - called: y=%d x=%d\n", y, x)); | ||
| 43 | |||
| 44 | if (!stdscr || x < 0 || y < 0 || x >= stdscr->_maxx || y >= stdscr->_maxy) | ||
| 45 | return ERR; | ||
| 46 | |||
| 47 | stdscr->_curx = x; | ||
| 48 | stdscr->_cury = y; | ||
| 49 | |||
| 50 | return OK; | ||
| 51 | } | ||
| 52 | |||
| 53 | int mvcur(int oldrow, int oldcol, int newrow, int newcol) | ||
| 54 | { | ||
| 55 | PDC_LOG(("mvcur() - called: oldrow %d oldcol %d newrow %d newcol %d\n", | ||
| 56 | oldrow, oldcol, newrow, newcol)); | ||
| 57 | |||
| 58 | if (!SP || newrow < 0 || newrow >= LINES || newcol < 0 || newcol >= COLS) | ||
| 59 | return ERR; | ||
| 60 | |||
| 61 | PDC_gotoyx(newrow, newcol); | ||
| 62 | SP->cursrow = newrow; | ||
| 63 | SP->curscol = newcol; | ||
| 64 | |||
| 65 | return OK; | ||
| 66 | } | ||
| 67 | |||
| 68 | int wmove(WINDOW *win, int y, int x) | ||
| 69 | { | ||
| 70 | PDC_LOG(("wmove() - called: y=%d x=%d\n", y, x)); | ||
| 71 | |||
| 72 | if (!win || x < 0 || y < 0 || x >= win->_maxx || y >= win->_maxy) | ||
| 73 | return ERR; | ||
| 74 | |||
| 75 | win->_curx = x; | ||
| 76 | win->_cury = y; | ||
| 77 | |||
| 78 | return OK; | ||
| 79 | } | ||
