aboutsummaryrefslogtreecommitdiffstats
path: root/Library/UefiShellUfmCommandLib/dialog-box.h
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-12-11 20:56:31 +0300
committerJoursoir <chat@joursoir.net>2021-12-11 20:56:31 +0300
commitdac697aebc8a5c680daf8bf35ce350ae994d03e4 (patch)
treeedd96831dc59f440c172b1ab323086b9b82985cd /Library/UefiShellUfmCommandLib/dialog-box.h
parent5e0ac5e316a3d33610b4681f0d4f246281a90bce (diff)
downloadufm-dac697aebc8a5c680daf8bf35ce350ae994d03e4.tar.gz
ufm-dac697aebc8a5c680daf8bf35ce350ae994d03e4.tar.bz2
ufm-dac697aebc8a5c680daf8bf35ce350ae994d03e4.zip
implement the dialog box
Diffstat (limited to 'Library/UefiShellUfmCommandLib/dialog-box.h')
-rw-r--r--Library/UefiShellUfmCommandLib/dialog-box.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/Library/UefiShellUfmCommandLib/dialog-box.h b/Library/UefiShellUfmCommandLib/dialog-box.h
new file mode 100644
index 0000000..d6d6e43
--- /dev/null
+++ b/Library/UefiShellUfmCommandLib/dialog-box.h
@@ -0,0 +1,47 @@
+#ifndef UFM_DIALOG_BOX_H
+#define UFM_DIALOG_BOX_H
+
+#include <Uefi.h>
+#include "widget/input.h"
+
+struct dbox_ctx {
+ struct window *wbg;
+ struct widget_input *in;
+ struct window *wok, *wcl;
+};
+
+/*
+ * Creates a dialog box with given parameters. Appears exactly in the
+ * middle of the screen
+ *
+ * scr: the information of the screen
+ * title: the pointer to title string
+ * label: the pointer to label string
+ * wid_input: TRUE if the dialog box needs an input widget. FALSE if not
+ * input_text: the pointer to initial string in the input widget. If
+ wid_input is false, the variable is ignored
+ *
+ * return: A pointer to the allocated structure or NULL if allocation fails
+*/
+struct dbox_ctx *dbox_alloc(struct screen *scr, CONST CHAR16 *title,
+ CONST CHAR16 *label, BOOLEAN wid_input, CONST CHAR16 *input_text);
+
+/*
+ * Deletes the dialog box, frees the structure
+ *
+ * dbox: the dialog box on which to operate
+ *
+ * return: VOID
+*/
+VOID dbox_release(struct dbox_ctx *dbox);
+
+/*
+ * Does the output of dialog box to the terminal
+ *
+ * dbox: the dialog box on which to operate
+ *
+ * return: VOID
+*/
+VOID dbox_refresh(struct dbox_ctx *dbox);
+
+#endif /* UFM_DIALOG_BOX_H */