iPXE
|
Dynamic user interfaces. More...
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ipxe/list.h>
#include <ipxe/dynui.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static | LIST_HEAD (dynamic_uis) |
List of all dynamic user interfaces. More... | |
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... | |
Dynamic user interfaces.
Definition in file dynui.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
List of all dynamic user interfaces.
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().