iPXE
cursor.h
Go to the documentation of this file.
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_OR_UBDL );
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  */
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  */
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 */
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
Definition: mucurses.c:135
Curses Window struct.
Definition: curses.h:89
unsigned int curs_y
Definition: curses.h:97
unsigned int y
Definition: cursor.h:13
static void _restore_curs_pos(WINDOW *win, struct cursor_pos *pos)
Restore cursor position from encoded backup variable.
Definition: cursor.h:22
unsigned int x
Definition: cursor.h:13
static void _store_curs_pos(WINDOW *win, struct cursor_pos *pos)
Store cursor position for later restoration.
Definition: cursor.h:32
unsigned int curs_x
window cursor position
Definition: curses.h:97
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)