|
iPXE
|
Dynamic user interfaces. More...
#include <ipxe/list.h>Go to the source code of this file.
Data Structures | |
| struct | dynamic_ui |
| A dynamic user interface. More... | |
| struct | dynamic_item |
| A dynamic user interface item. More... | |
Macros | |
| #define | DYNUI_DEFAULT 0x0001 |
| Dynamic user interface item is default selection. | |
| #define | DYNUI_SECRET 0x0002 |
| Dynamic user interface item represents a secret. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| struct dynamic_ui * | create_dynui (const char *name, const char *title) |
| Create dynamic user interface. | |
| 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. | |
| void | destroy_dynui (struct dynamic_ui *dynui) |
| Destroy dynamic user interface. | |
| struct dynamic_ui * | find_dynui (const char *name) |
| Find dynamic user interface. | |
| struct dynamic_item * | dynui_item (struct dynamic_ui *dynui, unsigned int index) |
| Find dynamic user interface item by index. | |
| struct dynamic_item * | dynui_shortcut (struct dynamic_ui *dynui, int key) |
| Find dynamic user interface item by shortcut key. | |
| int | show_menu (struct dynamic_ui *dynui, unsigned long timeout, unsigned long retimeout, const char *select, struct dynamic_item **selected) |
| Show menu. | |
| int | show_form (struct dynamic_ui *dynui) |
| Show form. | |
Dynamic user interfaces.
Definition in file dynui.h.
| #define DYNUI_DEFAULT 0x0001 |
Dynamic user interface item is default selection.
Definition at line 46 of file dynui.h.
Referenced by item_exec(), layout_form(), and show_menu().
| #define DYNUI_SECRET 0x0002 |
Dynamic user interface item represents a secret.
Definition at line 49 of file dynui.h.
Referenced by item_exec(), and layout_form().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Create dynamic user interface.
| name | User interface name, or NULL |
| title | User interface title, or NULL |
| dynui | Dynamic user interface, or NULL on failure |
Definition at line 49 of file dynui.c.
References DBGC, destroy_dynui(), find_dynui(), INIT_LIST_HEAD, dynamic_ui::items, len, dynamic_ui::list, list_add_tail, dynamic_ui::name, name, NULL, strcpy(), strlen(), dynamic_ui::title, and zalloc().
Referenced by dynui_exec().
|
extern |
Add dynamic user interface item.
| dynui | Dynamic user interface |
| name | Name, or NULL |
| text | Text, or NULL |
| flags | Flags |
| shortcut | Shortcut key |
| item | User interface item, or NULL on failure |
Definition at line 104 of file dynui.c.
References dynamic_ui::count, dynamic_item::flags, flags, dynamic_item::index, dynamic_ui::items, len, dynamic_item::list, list_add_tail, dynamic_item::name, name, NULL, dynamic_item::shortcut, strcpy(), strlen(), dynamic_item::text, and zalloc().
Referenced by item_exec().
|
extern |
Destroy dynamic user interface.
| dynui | Dynamic user interface |
Definition at line 150 of file dynui.c.
References free, dynamic_ui::items, dynamic_item::list, dynamic_ui::list, list_del, list_for_each_entry_safe, and tmp.
Referenced by choose_exec(), create_dynui(), dynui_exec(), and present_exec().
|
extern |
Find dynamic user interface.
| name | User interface name, or NULL |
| dynui | Dynamic user interface, or NULL if not found |
Definition at line 173 of file dynui.c.
References dynamic_ui::list, list_for_each_entry, dynamic_ui::name, name, NULL, and strcmp().
Referenced by create_dynui(), and parse_dynui().
|
extern |
Find dynamic user interface item by index.
| dynui | Dynamic user interface |
| index | Index |
| item | User interface item, or NULL if not found |
Definition at line 193 of file dynui.c.
References index, dynamic_ui::items, dynamic_item::list, list_for_each_entry, and NULL.
Referenced by draw_menu_item(), and menu_loop().
|
extern |
Find dynamic user interface item by shortcut key.
| dynui | Dynamic user interface |
| key | Shortcut key |
| item | User interface item, or NULL if not found |
Definition at line 212 of file dynui.c.
References dynamic_ui::items, key, dynamic_item::list, list_for_each_entry, NULL, and dynamic_item::shortcut.
Referenced by form_loop(), and menu_loop().
|
extern |
Show menu.
| dynui | Dynamic user interface |
| timeout | Initial timeout period, in ticks (0=indefinite) |
| retimeout | Post-activity timeout period, in ticks (0=indefinite) |
| selected | Selected item |
| rc | Return status code |
Definition at line 252 of file menu_ui.c.
References A_BOLD, assert, attroff(), attron(), color_set, COLS, jump_scroller::count, CPAIR_NORMAL, jump_scroller::current, curs_set(), draw_menu_item(), draw_menu_items(), menu_ui::dynui, DYNUI_DEFAULT, endwin(), ENOENT, erase(), dynamic_item::flags, initscr(), dynamic_ui::items, jump_scroll(), list_for_each_entry, memset(), MENU_COLS, menu_loop(), MENU_ROWS, mvprintw, dynamic_item::name, NULL, rc, menu_ui::retimeout, jump_scroller::rows, menu_ui::scroll, select(), snprintf(), start_color, strcmp(), strlen(), menu_ui::timeout, timeout(), dynamic_ui::title, and TITLE_ROW.
Referenced by choose_exec().
|
extern |
Show form.
| dynui | Dynamic user interface |
| rc | Return status code |
Definition at line 508 of file form_ui.c.
References alloc_form(), color_set, CPAIR_NORMAL, draw_form(), form::dynui, endwin(), ENOMEM, form_loop(), free_form(), initscr(), layout_form(), load_values(), NULL, parse_names(), rc, and start_color.
Referenced by login_ui(), and present_exec().