From 2498e52020252a6f915c6c5242509fe06e6b02e8 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Thu, 4 Nov 2021 03:28:28 +0300 Subject: implement the menu bar --- src/menu-bar.c | 25 +++++++++++++++++++++++++ src/menu-bar.h | 17 +++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/menu-bar.c create mode 100644 src/menu-bar.h diff --git a/src/menu-bar.c b/src/menu-bar.c new file mode 100644 index 0000000..db7af38 --- /dev/null +++ b/src/menu-bar.c @@ -0,0 +1,25 @@ +#include + +#include "lib/tbi/screen.h" +#include "lib/tbi/win.h" +#include "menu-bar.h" + +struct window *menubar = NULL; + +BOOLEAN init_menubar(struct screen *scr) +{ + menubar = newwin(scr, scr->columns, 1, 0, 0); + if(!menubar) + return FALSE; + + wrefresh(menubar); + return TRUE; +} + +VOID free_menubar(VOID) +{ + ASSERT(menubar != NULL); + + delwin(menubar); + menubar = NULL; +} diff --git a/src/menu-bar.h b/src/menu-bar.h new file mode 100644 index 0000000..9012f9f --- /dev/null +++ b/src/menu-bar.h @@ -0,0 +1,17 @@ +#ifndef UFM_MENU_BAR_H +#define UFM_MENU_BAR_H + +/* + * Menu bar: + * Located on the first line, occupies its entire length. + * At the moment, nothing is planned here, a reserve for the future +*/ + +#include + +struct screen; + +BOOLEAN init_menubar(struct screen *scr); +VOID free_menubar(VOID); + +#endif /* UFM_MENU_BAR_H */ -- cgit v1.2.3-18-g5258