kNCurses/include/NCurses/VerticalTilingWindowManager.hpp
Christian Burger b9e32941fb hide and show windows in window manager
* switching to recursive mutexes for now; easier to implement
* need to read user input from the window manager; hidden windows are
drawn when reading input from there
* note: occasional dead lock between PTY and ncurses mutex
* fixed type in class `SingleUserInput`
2022-05-06 14:02:18 +02:00

41 lines
1 KiB
C++

/**
* @brief Window manager
* @author Christian Burger (christian@krikkel.de)
*/
#ifndef C10F5DF3_1DB4_4714_A84D_115F492F5CDC
#define C10F5DF3_1DB4_4714_A84D_115F492F5CDC
#include <ncursesw/cursesw.h>
#include <list>
#include <mutex>
namespace krikkel::NCurses
{
class Window;
class SingleUserInput;
class VerticalTilingWindowManager
{
public:
VerticalTilingWindowManager(NCursesWindow *rootWindow, std::recursive_mutex *ncursesMutex);
void addWindow(Window *window);
void refresh();
void updateLayout();
void hideWindow(Window *window);
void showWindow(Window *window);
SingleUserInput readSingleUserInput();
private:
Window *rootWindow;
std::recursive_mutex *ncursesMutex;
std::list<Window *> stack, visibleStack;
void resizeWindowInStack(Window *window, uint16_t y, uint16_t height, uint16_t width);
};
}
#endif /* C10F5DF3_1DB4_4714_A84D_115F492F5CDC */