• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef CURSOR_H
2 #define CURSOR_H
3 
4 /** @file
5  *
6  * MuCurses cursor implementation specific header file
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER );
11 
12 struct cursor_pos {
13 	unsigned int y, x;
14 };
15 
16 /**
17  * Restore cursor position from encoded backup variable
18  *
19  * @v *win	window on which to operate
20  * @v *pos	pointer to struct in which original cursor position is stored
21  */
_restore_curs_pos(WINDOW * win,struct cursor_pos * pos)22 static inline void _restore_curs_pos ( WINDOW *win, struct cursor_pos *pos ) {
23 	wmove ( win, pos->y, pos->x );
24 }
25 
26 /**
27  * Store cursor position for later restoration
28  *
29  * @v *win	window on which to operate
30  * @v *pos	pointer to struct in which to store cursor position
31  */
_store_curs_pos(WINDOW * win,struct cursor_pos * pos)32 static inline void _store_curs_pos ( WINDOW *win, struct cursor_pos *pos ) {
33 	pos->y = win->curs_y;
34 	pos->x = win->curs_x;
35 }
36 
37 #endif /* CURSOR_H */
38