added ncurses addnwstr() to window

This commit is contained in:
Christian Burger 2022-04-26 20:53:14 +02:00
parent ed534363a2
commit a300dd492b
2 changed files with 18 additions and 6 deletions

View file

@ -10,6 +10,11 @@ namespace krikkel::NCursesPtyWindow
: NCursesWindow(lines, columns, y, x) : NCursesWindow(lines, columns, y, x)
{} {}
int Window::addnwstr(const wchar_t *wstr, int n)
{
return ::waddnwstr(w, wstr, n);
}
int Window::add_wch(const cchar_t *character) int Window::add_wch(const cchar_t *character)
{ {
return ::wadd_wch(w, character); return ::wadd_wch(w, character);

View file

@ -10,30 +10,37 @@
#include <ncursesw/cursesw.h> #include <ncursesw/cursesw.h>
#ifdef addnwstr
inline void UNDEF(addnwstr)(const wchar_t *wstr, int n) { addnwstr(wstr, n); }
#undef addnwstr
#define addnwstr UNDEF(addnwstr)
#endif
#ifdef add_wch #ifdef add_wch
inline void UNDEF(add_wch)(const cchar_t *character) { add_wch(character); } inline void UNDEF(add_wch)(const cchar_t *character) { add_wch(character); }
#undef add_wch #undef add_wch
#define add_wch UNDEF(add_wch) #define add_wch UNDEF(add_wch)
#endif #endif
#ifdef get_wch
inline void UNDEF(get_wch)(wint_t *character) { get_wch(character); }
#undef get_wch
#define get_wch UNDEF(get_wch)
#endif
#ifdef ins_wch #ifdef ins_wch
inline void UNDEF(ins_wch)(cchar_t *character) { ins_wch(character); } inline void UNDEF(ins_wch)(cchar_t *character) { ins_wch(character); }
#undef ins_wch #undef ins_wch
#define ins_wch UNDEF(ins_wch) #define ins_wch UNDEF(ins_wch)
#endif #endif
#ifdef get_wch
inline void UNDEF(get_wch)(wint_t *character) { get_wch(character); }
#undef get_wch
#define get_wch UNDEF(get_wch)
#endif
namespace krikkel::NCursesPtyWindow namespace krikkel::NCursesPtyWindow
{ {
class Window : public NCursesWindow class Window : public NCursesWindow
{ {
public: public:
Window(int lines, int columns, int y, int x); 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 add_wch(const cchar_t *character);
int ins_wch(const cchar_t *character); int ins_wch(const cchar_t *character);
int get_wch(wint_t *character); int get_wch(wint_t *character);