From 664721d00557257412cbcd0cd50f5b8b5d8cec7e Mon Sep 17 00:00:00 2001 From: PoliEcho Date: Mon, 14 Apr 2025 10:54:33 +0200 Subject: [PATCH] add basic menu structure --- src/main.cpp | 6 +++--- src/menu.cpp | 19 +++++++++++++++++++ src/menu.h | 7 +++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9e4a582..05f0d43 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include #include "color.h" #include "const.h" +#include "menu.h" void PrintHelp() { std::cout << RED R"( ____ ____ @@ -41,8 +42,7 @@ int main(int argc, char* argv[]) { return EINVAL; } } + menu(); - for (int i = 0; i < 10; i++) { - std::cout << "trestní oznámení\n"; - } + return 0; } diff --git a/src/menu.cpp b/src/menu.cpp index e69de29..a19db91 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -0,0 +1,19 @@ +#include +#include +#include + +void menu() { + + /* Initialize curses */ + setlocale(LC_ALL, ""); + initscr(); + start_color(); + cbreak(); + noecho(); + keypad(stdscr, TRUE); + + /* Initialize all colors */ + for (uint8_t i = 0; i < 8; i++) { + init_pair(i, i, COLOR_BLACK); + } +} \ No newline at end of file diff --git a/src/menu.h b/src/menu.h index e69de29..35882a2 100644 --- a/src/menu.h +++ b/src/menu.h @@ -0,0 +1,7 @@ + +#ifndef PARADOCS_MENU_H_ +#define PARADOCS_MENU_H_ + +void menu(); + +#endif \ No newline at end of file