summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/dynui.h
diff options
context:
space:
mode:
authorSimon Rettberg2026-01-28 12:53:53 +0100
committerSimon Rettberg2026-01-28 12:53:53 +0100
commit8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch)
treea8b359e59196be5b2e3862bed189107f4bc9975f /src/include/ipxe/dynui.h
parentMerge branch 'master' into openslx (diff)
parent[prefix] Make unlzma.S compatible with 386 class CPUs (diff)
downloadipxe-openslx.tar.gz
ipxe-openslx.tar.xz
ipxe-openslx.zip
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/include/ipxe/dynui.h')
-rw-r--r--src/include/ipxe/dynui.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/include/ipxe/dynui.h b/src/include/ipxe/dynui.h
new file mode 100644
index 000000000..02179ef18
--- /dev/null
+++ b/src/include/ipxe/dynui.h
@@ -0,0 +1,73 @@
+#ifndef _IPXE_DYNUI_H
+#define _IPXE_DYNUI_H
+
+/** @file
+ *
+ * Dynamic user interfaces
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
+
+#include <ipxe/list.h>
+
+/** A dynamic user interface */
+struct dynamic_ui {
+ /** List of dynamic user interfaces */
+ struct list_head list;
+ /** Name */
+ const char *name;
+ /** Title */
+ const char *title;
+ /** Dynamic user interface items */
+ struct list_head items;
+ /** Hidden user interface items, accessible only via hotkey */
+ struct list_head hidden_items;
+ /** Number of user interface items */
+ unsigned int count;
+};
+
+/** A dynamic user interface item */
+struct dynamic_item {
+ /** List of dynamic user interface items */
+ struct list_head list;
+ /** Name */
+ const char *name;
+ /** Text */
+ const char *text;
+ /** Index */
+ unsigned int index;
+ /** Flags */
+ unsigned int flags;
+ /** Shortcut key */
+ int shortcut;
+};
+
+/** Dynamic user interface item is default selection */
+#define DYNUI_DEFAULT 0x0001
+
+/** Dynamic user interface item represents a secret */
+#define DYNUI_SECRET 0x0002
+
+/** Dynamic user interface item should be invisible */
+#define DYNUI_HIDDEN 0x0004
+
+extern struct dynamic_ui * create_dynui ( const char *name, const char *title );
+extern struct dynamic_item * add_dynui_item ( struct dynamic_ui *dynui,
+ const char *name,
+ const char *text,
+ unsigned int flags,
+ int shortcut );
+extern void destroy_dynui ( struct dynamic_ui *dynui );
+extern struct dynamic_ui * find_dynui ( const char *name );
+extern struct dynamic_item * dynui_item ( struct dynamic_ui *dynui,
+ unsigned int index );
+extern struct dynamic_item * dynui_shortcut ( struct dynamic_ui *dynui,
+ int key );
+extern int show_menu ( struct dynamic_ui *dynui, unsigned long timeout,
+ unsigned long retimeout, const char *select,
+ struct dynamic_item **selected );
+extern int show_form ( struct dynamic_ui *dynui );
+
+#endif /* _IPXE_DYNUI_H */