aboutsummaryrefslogtreecommitdiffstats
path: root/Library/UefiShellUfmCommandLib
diff options
context:
space:
mode:
Diffstat (limited to 'Library/UefiShellUfmCommandLib')
-rw-r--r--Library/UefiShellUfmCommandLib/menu-bar.c27
-rw-r--r--Library/UefiShellUfmCommandLib/menu-bar.h6
2 files changed, 20 insertions, 13 deletions
diff --git a/Library/UefiShellUfmCommandLib/menu-bar.c b/Library/UefiShellUfmCommandLib/menu-bar.c
index ff1ac7e..0503388 100644
--- a/Library/UefiShellUfmCommandLib/menu-bar.c
+++ b/Library/UefiShellUfmCommandLib/menu-bar.c
@@ -4,22 +4,27 @@
#include "tbi/win.h"
#include "menu-bar.h"
-struct window *menubar = NULL;
-
-BOOLEAN init_menubar(struct screen *scr)
+struct window *init_menubar(struct screen *scr)
{
- menubar = newwin(scr, scr->columns, 1, 0, 0);
+ struct window *menubar = newwin(scr, scr->columns, 1, 0, 0);
if(!menubar)
- return FALSE;
+ return NULL;
- wrefresh(menubar);
- return TRUE;
+ mvwprintf(menubar, 0, 0, L"Menu bar");
+ menubar_refresh(menubar);
+ return menubar;
}
-VOID free_menubar(VOID)
+VOID free_menubar(struct window *w)
{
- ASSERT(menubar != NULL);
+ ASSERT(w != NULL);
+
+ delwin(w);
+}
- delwin(menubar);
- menubar = NULL;
+VOID menubar_refresh(struct window *w)
+{
+ ASSERT(w != NULL);
+
+ wrefresh(w);
}
diff --git a/Library/UefiShellUfmCommandLib/menu-bar.h b/Library/UefiShellUfmCommandLib/menu-bar.h
index 9012f9f..85e1ce7 100644
--- a/Library/UefiShellUfmCommandLib/menu-bar.h
+++ b/Library/UefiShellUfmCommandLib/menu-bar.h
@@ -10,8 +10,10 @@
#include <Uefi.h>
struct screen;
+struct window;
-BOOLEAN init_menubar(struct screen *scr);
-VOID free_menubar(VOID);
+struct window *init_menubar(struct screen *scr);
+VOID free_menubar(struct window *w);
+VOID menubar_refresh(struct window *w);
#endif /* UFM_MENU_BAR_H */