iPXE
dynui.h
Go to the documentation of this file.
1 #ifndef _IPXE_DYNUI_H
2 #define _IPXE_DYNUI_H
3 
4 /** @file
5  *
6  * Dynamic user interfaces
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <ipxe/list.h>
13 
14 /** A dynamic user interface */
15 struct dynamic_ui {
16  /** List of dynamic user interfaces */
17  struct list_head list;
18  /** Name */
19  const char *name;
20  /** Title */
21  const char *title;
22  /** Dynamic user interface items */
23  struct list_head items;
24  /** Number of user interface items */
25  unsigned int count;
26 };
27 
28 /** A dynamic user interface item */
29 struct dynamic_item {
30  /** List of dynamic user interface items */
31  struct list_head list;
32  /** Name */
33  const char *name;
34  /** Text */
35  const char *text;
36  /** Index */
37  unsigned int index;
38  /** Flags */
39  unsigned int flags;
40  /** Shortcut key */
41  int shortcut;
42 };
43 
44 /** Dynamic user interface item is default selection */
45 #define DYNUI_DEFAULT 0x0001
46 
47 /** Dynamic user interface item represents a secret */
48 #define DYNUI_SECRET 0x0002
49 
50 extern struct dynamic_ui * create_dynui ( const char *name, const char *title );
51 extern struct dynamic_item * add_dynui_item ( struct dynamic_ui *dynui,
52  const char *name,
53  const char *text,
54  unsigned int flags,
55  int shortcut );
56 extern void destroy_dynui ( struct dynamic_ui *dynui );
57 extern struct dynamic_ui * find_dynui ( const char *name );
58 extern struct dynamic_item * dynui_item ( struct dynamic_ui *dynui,
59  unsigned int index );
60 extern struct dynamic_item * dynui_shortcut ( struct dynamic_ui *dynui,
61  int key );
62 extern int show_menu ( struct dynamic_ui *dynui, unsigned long timeout,
63  const char *select, struct dynamic_item **selected );
64 extern int show_form ( struct dynamic_ui *dynui );
65 
66 #endif /* _IPXE_DYNUI_H */
const char * title
Title.
Definition: dynui.h:21
const char * name
Definition: ath9k_hw.c:1984
A dynamic user interface item.
Definition: dynui.h:29
int show_menu(struct dynamic_ui *dynui, unsigned long timeout, const char *select, struct dynamic_item **selected)
Show menu.
Definition: menu_ui.c:248
struct dynamic_item * add_dynui_item(struct dynamic_ui *dynui, const char *name, const char *text, unsigned int flags, int shortcut)
Add dynamic user interface item.
Definition: dynui.c:103
void destroy_dynui(struct dynamic_ui *dynui)
Destroy dynamic user interface.
Definition: dynui.c:149
long index
Definition: bigint.h:62
struct dynamic_ui * find_dynui(const char *name)
Find dynamic user interface.
Definition: dynui.c:172
unsigned int count
Number of user interface items.
Definition: dynui.h:25
struct dynamic_ui * create_dynui(const char *name, const char *title)
Create dynamic user interface.
Definition: dynui.c:48
A doubly-linked list entry (or list head)
Definition: list.h:18
struct dynamic_item * dynui_item(struct dynamic_ui *dynui, unsigned int index)
Find dynamic user interface item by index.
Definition: dynui.c:192
struct dynamic_item * dynui_shortcut(struct dynamic_ui *dynui, int key)
Find dynamic user interface item by shortcut key.
Definition: dynui.c:211
struct list_head items
Dynamic user interface items.
Definition: dynui.h:23
const char * name
Name.
Definition: dynui.h:33
Linked lists.
uint8_t flags
Flags.
Definition: ena.h:18
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
Definition: posix_io.c:229
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int show_form(struct dynamic_ui *dynui)
Show form.
Definition: form_ui.c:507
A dynamic user interface.
Definition: dynui.h:15
int shortcut
Shortcut key.
Definition: dynui.h:41
const char * text
Text.
Definition: dynui.h:35
struct list_head list
List of dynamic user interfaces.
Definition: dynui.h:17
const char * name
Name.
Definition: dynui.h:19
void timeout(int)
unsigned int flags
Flags.
Definition: dynui.h:39
unsigned int index
Index.
Definition: dynui.h:37
struct list_head list
List of dynamic user interface items.
Definition: dynui.h:31
union @383 key
Sense key.
Definition: scsi.h:18