33 #include <yui/YEvent.h>
34 #include <yui/YWidget.h>
35 #include <yui/YMenuItem.h>
37 #include <ncursesw/curses.h>
57 NCursesError(
int val,
const char * msg =
"unknown error", ... );
61 NCursesError & NCError(
const char * msg =
"unknown error", ... );
62 NCursesError & NCError(
int val,
const char * msg =
"unknown error", ... );
64 virtual const char * location()
const {
return "NCurses"; }
67 extern std::ostream & operator<<( std::ostream & STREAM,
const NCursesError & OBJ );
96 YMenuItem * selection;
100 std::string keySymbol;
104 YEvent::EventReason reason;
106 NCursesEvent( Type t = none, YEvent::EventReason r = YEvent::UnknownReason )
118 operator void*()
const {
return type != none ? (
void* )1 : (
void* )0; }
120 bool operator==(
const NCursesEvent & e )
const {
return type == e.type; }
122 bool operator!=(
const NCursesEvent & e )
const {
return type != e.type; }
124 bool isReturnEvent()
const {
return type > none; }
126 bool isInternalEvent()
const {
return type < none; }
136 extern std::ostream & operator<<( std::ostream & STREAM,
const NCursesEvent & OBJ );
143 friend std::ostream & operator<<( std::ostream & STREAM,
const NCurses & OBJ );
152 static WINDOW * ripped_w_top;
153 static WINDOW * ripped_w_bottom;
154 static int ripinit_top( WINDOW * ,
int );
155 static int ripinit_bottom( WINDOW * ,
int );
166 std::map <int, std::string> status_line;
172 bool initialized()
const {
return stdpan; }
174 virtual bool title_line() {
return true; }
176 virtual bool want_colors() {
return true; }
178 virtual void setup_screen();
179 virtual void init_title();
180 virtual void init_screen();
190 static int cols() { return ::COLS; }
192 static int lines() { return ::LINES; }
194 static int tabsize() { return ::TABSIZE; }
200 static const NCstyle & style();
202 static void Update();
203 static void Redraw();
204 static void Refresh();
205 static void SetTitle(
const std::string & str );
206 static void SetStatusLine( std::map <int, std::string> fkeys );
207 static void ScreenShot(
const std::string & name =
"screen.shot" );
209 static void drawTitle();
213 static void ForgetDlg(
NCDialog * dlg_r );
214 static void RememberDlg(
NCDialog * dlg_r );
215 void RedirectToLog();
216 static void ResizeEvent();
219 static std::set<NCDialog*> _knownDlgs;
223 #define CTRL(x) ((x) & 0x1f)
225 #define KEY_RETURN 012
227 #define KEY_SPACE 040
228 #define KEY_HOTKEY KEY_MAX+1