kNCurses/include/NCurses/Window.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

64 lines
1.6 KiB
C++

/**
* @brief Providing wide character methods missing in NCursesWindow.
* @author Christian Burger (christian@krikkel.de)
*/
#ifndef A2C3FDB7_7A85_4527_BC85_366E14149EB8
#define A2C3FDB7_7A85_4527_BC85_366E14149EB8
#include "SingleUserInput.hpp"
#include <ncursesw/cursesw.h>
#ifdef addnwstr
inline int UNDEF(addnwstr)(const wchar_t *wstr, int n) { addnwstr(wstr, n); }
#undef addnwstr
#define addnwstr UNDEF(addnwstr)
#endif
#ifdef add_wch
inline int UNDEF(add_wch)(const cchar_t *character) { add_wch(character); }
#undef add_wch
#define add_wch UNDEF(add_wch)
#endif
#ifdef ins_wch
inline int UNDEF(ins_wch)(cchar_t *character) { ins_wch(character); }
#undef ins_wch
#define ins_wch UNDEF(ins_wch)
#endif
#ifdef get_wch
inline int UNDEF(get_wch)(wint_t *character) { get_wch(character); }
#undef get_wch
#define get_wch UNDEF(get_wch)
#endif
namespace krikkel::NCurses
{
class VerticalTilingWindowManager;
class Window : public NCursesWindow
{
friend class VerticalTilingWindowManager;
public:
Window(VerticalTilingWindowManager *windowManager);
Window(const NCursesWindow &window);
Window(int lines, int columns, int y, int x);
int addnwstr(const wchar_t *wstr, int n);
int add_wch(const cchar_t *character);
int ins_wch(const cchar_t *character);
int get_wch(wint_t *character);
SingleUserInput readSingleUserInput();
virtual int resize(int rows, int cols);
virtual int refresh() override;
protected:
bool hidden = false;
};
}
#endif /* A2C3FDB7_7A85_4527_BC85_366E14149EB8 */