2010-04-30 17:33:21 +00:00
|
|
|
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
|
|
|
|
* vim: ts=4 sw=4 noet ai cindent syntax=cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "nc.h"
|
|
|
|
|
2016-07-20 16:53:48 +00:00
|
|
|
#ifdef BUILD_NCURSES
|
|
|
|
WINDOW* ncurses_window;
|
|
|
|
#endif
|
|
|
|
|
2010-04-30 17:33:21 +00:00
|
|
|
namespace priv {
|
|
|
|
void out_to_ncurses_setting::lua_setter(lua::state &l, bool init)
|
|
|
|
{
|
|
|
|
lua::stack_sentry s(l, -2);
|
|
|
|
|
|
|
|
Base::lua_setter(l, init);
|
|
|
|
|
|
|
|
if(init && do_convert(l, -1).first) {
|
2016-07-20 16:53:48 +00:00
|
|
|
ncurses_window = initscr();
|
2010-04-30 17:33:21 +00:00
|
|
|
start_color();
|
|
|
|
}
|
|
|
|
|
|
|
|
++s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void out_to_ncurses_setting::cleanup(lua::state &l)
|
|
|
|
{
|
|
|
|
lua::stack_sentry s(l, -1);
|
|
|
|
|
|
|
|
if(do_convert(l, -1).first)
|
|
|
|
endwin();
|
|
|
|
|
|
|
|
l.pop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
priv::out_to_ncurses_setting out_to_ncurses;
|