26 #include <ncursesw/curses.h>
28 #define YUILogComponent "ncurses"
29 #include <yui/YUILog.h>
31 #include "YNCursesUI.h"
32 #include "NCApplication.h"
33 #include "NCAskForDirectory.h"
34 #include "NCAskForFile.h"
50 const std::string & encoding )
56 setlocale( LC_NUMERIC,
"C" );
59 yuiDebug() <<
"Language: " << language <<
" Encoding: " << (( encoding !=
"" ) ? encoding :
"NOT SET" ) << std::endl;
66 const std::string & filter,
67 const std::string & headline )
70 YUI_CHECK_NEW( filePopup );
73 YDialog::deleteTopmostDialog();
75 yuiMilestone() <<
"Returning: " << retEvent.result << std::endl;
76 return retEvent.result;
82 const std::string & filter,
83 const std::string & headline )
86 YUI_CHECK_NEW( filePopup );
89 YDialog::deleteTopmostDialog();
91 yuiMilestone() <<
"Returning: " << retEvent.result << std::endl;
92 return retEvent.result;
98 const std::string & headline )
101 YUI_CHECK_NEW( dirPopup );
104 YDialog::deleteTopmostDialog();
106 yuiMilestone() <<
"Returning: " << retEvent.result << std::endl;
107 return retEvent.result;
136 std::string cmd =
"/bin/dumpkeys | /bin/loadkeys --unicode";
138 if ( NCstring::terminalEncoding() ==
"UTF-8" )
140 int ret = system(( cmd +
" >/dev/null 2>&1" ).c_str() );
144 yuiError() <<
"ERROR: /bin/dumpkeys | /bin/loadkeys --unicode returned: " << ret << std::endl;
153 const std::string & font,
154 const std::string & screen_map,
155 const std::string & unicode_map,
156 const std::string & language )
188 ret = system( cmd.c_str() );
192 yuiError() << cmd <<
" returned:" << ret << std::endl;
208 NCApplication::displayWidth()
215 NCApplication::displayHeight()
222 NCApplication::displayDepth()
229 NCApplication::displayColors()
231 return NCattribute::colors();
236 NCApplication::defaultWidth()
243 NCApplication::defaultHeight()
250 NCApplication::hasFullUtf8Support()
252 return ( NCstring::terminalEncoding() ==
"UTF-8" );
257 YApplication::setApplicationTitle ( title );
258 NCurses::SetTitle(title);
virtual std::string askForSaveFileName(const std::string &startWith, const std::string &filter, const std::string &headline)
virtual void setApplicationTitle(const std::string &title)
virtual void redrawScreen()
virtual void setConsoleFont(const std::string &console_magic, const std::string &font, const std::string &screen_map, const std::string &unicode_map, const std::string &lang)
virtual int runInTerminal(const std::string &command)
virtual void initConsoleKeyboard()
virtual void setLanguage(const std::string &language, const std::string &encoding=std::string())
virtual std::string askForExistingDirectory(const std::string &startDir, const std::string &headline)
NCursesEvent & showDirPopup()
NCursesEvent & showDirPopup()
virtual std::string askForExistingFile(const std::string &startWith, const std::string &filter, const std::string &headline)
virtual void setConsoleFont(const std::string &console_magic, const std::string &font, const std::string &screen_map, const std::string &unicode_map, const std::string &language)