1 #ifndef _IPXE_JUMPSCROLL_H
2 #define _IPXE_JUMPSCROLL_H
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
12 /** A jump scroller */
13 struct jump_scroller {
14 /** Maximum number of visible rows */
16 /** Total number of items */
18 /** Currently selected item */
20 /** First visible item */
25 * Check if jump scroller is currently on first page
27 * @v scroll Jump scroller
28 * @ret is_first Scroller is currently on first page
30 static inline int jump_scroll_is_first ( struct jump_scroller *scroll ) {
32 return ( scroll->first == 0 );
36 * Check if jump scroller is currently on last page
38 * @v scroll Jump scroller
39 * @ret is_last Scroller is currently on last page
41 static inline int jump_scroll_is_last ( struct jump_scroller *scroll ) {
43 return ( ( scroll->first + scroll->rows ) >= scroll->count );
46 extern int jump_scroll_key ( struct jump_scroller *scroll, int key );
47 extern int jump_scroll_move ( struct jump_scroller *scroll, int move );
48 extern int jump_scroll ( struct jump_scroller *scroll );
50 #endif /* _IPXE_JUMPSCROLL_H */