33#include <yui/YEvent.h>
34#include <yui/YWidget.h>
35#include <yui/YMenuItem.h>
37#include <ncursesw/curses.h>
58 NCursesError(
int val,
const char * msg =
"unknown error", ... );
62 NCursesError & NCError(
const char * msg =
"unknown error", ... );
63 NCursesError & NCError(
int val,
const char * msg =
"unknown error", ... );
65 virtual const char * location()
const {
return "NCurses"; }
68extern std::ostream & operator<<( std::ostream & str,
const NCursesError & obj );
99 YMenuItem * selection;
103 std::string keySymbol;
107 YEvent::EventReason reason;
109 NCursesEvent( Type t = none, YEvent::EventReason r = YEvent::UnknownReason )
121 operator void*()
const {
return type != none ? (
void* )1 : (
void* )0; }
123 bool operator==(
const NCursesEvent & e )
const {
return type == e.type; }
125 bool operator!=(
const NCursesEvent & e )
const {
return type != e.type; }
127 bool isReturnEvent()
const {
return type > none; }
129 bool isInternalEvent()
const {
return type < none; }
139extern std::ostream & operator<<( std::ostream & str,
const NCursesEvent & obj );
146 friend std::ostream & operator<<( std::ostream & str,
const NCurses & obj );
155 static WINDOW * ripped_w_top;
156 static WINDOW * ripped_w_bottom;
157 static int ripinit_top( WINDOW * ,
int );
158 static int ripinit_bottom( WINDOW * ,
int );
169 std::map <int, NCstring> status_line;
175 bool initialized()
const {
return stdpan; }
177 virtual bool title_line() {
return true; }
179 virtual bool want_colors() {
return true; }
181 virtual void setup_screen();
182 virtual void init_title();
183 virtual void init_screen();
193 static int cols() { return ::COLS; }
195 static int lines() { return ::LINES; }
197 static int tabsize() { return ::TABSIZE; }
203 static const NCstyle & style();
205 static void Update();
206 static void Redraw();
207 static void Refresh();
208 static void SetTitle(
const std::string & str );
209 static void SetStatusLine( std::map <int, NCstring> fkeys );
210 static void ScreenShot(
const std::string & name =
"screen.shot" );
212 static void drawTitle();
216 static void ForgetDlg(
NCDialog * dlg_r );
217 static void RememberDlg(
NCDialog * dlg_r );
218 void RedirectToLog();
219 static void ResizeEvent();
222 static std::set<NCDialog*> _knownDlgs;
226#define CTRL(x) ((x) & 0x1f)
228#define KEY_RETURN 012
231#define KEY_HOTKEY KEY_MAX+1