You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cursor.c 724B

12345678910111213141516171819202122232425262728293031
  1. #include <curses.h>
  2. #include "cursor.h"
  3. /** @file
  4. *
  5. * MuCurses cursor preserving functions
  6. *
  7. */
  8. /**
  9. * Restore cursor position from encoded backup variable
  10. *
  11. * @v *win window on which to operate
  12. * @v *pos pointer to struct in which original cursor position is stored
  13. */
  14. void _restore_curs_pos ( WINDOW *win, struct cursor_pos *pos ) {
  15. win->curs_y = pos->y;
  16. win->curs_x = pos->x;
  17. win->scr->movetoyx ( win->scr, win->curs_y, win->curs_x );
  18. }
  19. /**
  20. * Store cursor position for later restoration
  21. *
  22. * @v *win window on which to operate
  23. * @v *pos pointer to struct in which to store cursor position
  24. */
  25. void _store_curs_pos ( WINDOW *win, struct cursor_pos *pos ) {
  26. pos->y = win->curs_y;
  27. pos->x = win->curs_x;
  28. }