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"; }
68 extern std::ostream & operator<<( std::ostream & str,
const NCursesError & obj );
97 YMenuItem * selection;
101 std::string keySymbol;
105 YEvent::EventReason reason;
107 NCursesEvent( Type t = none, YEvent::EventReason r = YEvent::UnknownReason )
119 operator void*()
const {
return type != none ? (
void* )1 : (
void* )0; }
121 bool operator==(
const NCursesEvent & e )
const {
return type == e.type; }
123 bool operator!=(
const NCursesEvent & e )
const {
return type != e.type; }
125 bool isReturnEvent()
const {
return type > none; }
127 bool isInternalEvent()
const {
return type < none; }
137 extern std::ostream & operator<<( std::ostream & str,
const NCursesEvent & obj );
144 friend std::ostream & operator<<( std::ostream & str,
const NCurses & obj );
153 static WINDOW * ripped_w_top;
154 static WINDOW * ripped_w_bottom;
155 static int ripinit_top( WINDOW * ,
int );
156 static int ripinit_bottom( WINDOW * ,
int );
167 std::map <int, NCstring> status_line;
173 bool initialized()
const {
return stdpan; }
175 virtual bool title_line() {
return true; }
177 virtual bool want_colors() {
return true; }
179 virtual void setup_screen();
180 virtual void init_title();
181 virtual void init_screen();
191 static int cols() { return ::COLS; }
193 static int lines() { return ::LINES; }
195 static int tabsize() { return ::TABSIZE; }
201 static const NCstyle & style();
203 static void Update();
204 static void Redraw();
205 static void Refresh();
206 static void SetTitle(
const std::string & str );
207 static void SetStatusLine( std::map <int, NCstring> fkeys );
208 static void ScreenShot(
const std::string & name =
"screen.shot" );
210 static void drawTitle();
214 static void ForgetDlg(
NCDialog * dlg_r );
215 static void RememberDlg(
NCDialog * dlg_r );
216 void RedirectToLog();
217 static void ResizeEvent();
220 static std::set<NCDialog*> _knownDlgs;
224 #define CTRL(x) ((x) & 0x1f) 226 #define KEY_RETURN 012 228 #define KEY_SPACE 040 229 #define KEY_HOTKEY KEY_MAX+1