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. More... | |
#define | DYNUI_SECRET 0x0002 |
Dynamic user interface item represents a secret. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
struct dynamic_ui * | create_dynui (const char *name, const char *title) |
Create dynamic user interface. More... | |
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. More... | |
void | destroy_dynui (struct dynamic_ui *dynui) |
Destroy dynamic user interface. More... | |
struct dynamic_ui * | find_dynui (const char *name) |
Find dynamic user interface. More... | |
struct dynamic_item * | dynui_item (struct dynamic_ui *dynui, unsigned int index) |
Find dynamic user interface item by index. More... | |
struct dynamic_item * | dynui_shortcut (struct dynamic_ui *dynui, int key) |
Find dynamic user interface item by shortcut key. More... | |
int | show_menu (struct dynamic_ui *dynui, unsigned long timeout, const char *select, struct dynamic_item **selected) |
Show menu. More... | |
int | show_form (struct dynamic_ui *dynui) |
Show form. More... | |
Dynamic user interfaces.
Definition in file dynui.h.
#define DYNUI_DEFAULT 0x0001 |
#define DYNUI_SECRET 0x0002 |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
struct dynamic_ui* create_dynui | ( | const char * | name, |
const char * | title | ||
) |
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 48 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().
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.
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 103 of file dynui.c.
References dynamic_ui::count, flags, dynamic_item::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().
void destroy_dynui | ( | struct dynamic_ui * | dynui | ) |
Destroy dynamic user interface.
dynui | Dynamic user interface |
Definition at line 149 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().
struct dynamic_ui* find_dynui | ( | const char * | name | ) |
Find dynamic user interface.
name | User interface name, or NULL |
dynui | Dynamic user interface, or NULL if not found |
Definition at line 172 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().
struct dynamic_item* dynui_item | ( | struct dynamic_ui * | dynui, |
unsigned int | index | ||
) |
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 192 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().
struct dynamic_item* dynui_shortcut | ( | struct dynamic_ui * | dynui, |
int | key | ||
) |
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 211 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().
int show_menu | ( | struct dynamic_ui * | dynui, |
unsigned long | timeout, | ||
const char * | select, | ||
struct dynamic_item ** | selected | ||
) |
Show menu.
dynui | Dynamic user interface |
timeout | Timeout period, in ticks (0=indefinite) |
selected | Selected item |
rc | Return status code |
Definition at line 248 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, 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().
int show_form | ( | struct dynamic_ui * | dynui | ) |
Show form.
dynui | Dynamic user interface |
rc | Return status code |
Definition at line 507 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().