28 #define YUILogComponent "ui"
31 #include "YApplication.h"
33 #include "YUIException.h"
34 #include "YShortcut.h"
37 #include "YCommandLine.h"
41 typedef std::map<std::string, int> YFunctionKeyMap;
47 : productName(
"openSUSE" )
48 , reverseLayout(
false )
51 std::string productName;
53 std::string applicationTitle;
54 std::string applicationIcon;
55 YFunctionKeyMap defaultFunctionKey;
63 YUI_CHECK_NEW( priv );
66 if ( cmdLine.
argc() > 0 )
67 priv->applicationTitle = cmdLine.
arg(0);
92 return priv->iconLoader->iconBasePath();
99 priv->iconLoader->setIconBasePath ( newIconBasePath );
103 YApplication::iconLoader()
105 return priv->iconLoader;
118 return priv->productName;
125 priv->reverseLayout = reverse;
131 return priv->reverseLayout;
138 YFunctionKeyMap::const_iterator result =
141 if ( result == priv->defaultFunctionKey.end() )
144 return result->second;
161 priv->defaultFunctionKey.clear();
170 if ( ! encoding.empty() )
176 setenv(
"LANG", lang.c_str(), 1 );
177 setlocale( LC_NUMERIC,
"C" );
179 yuiMilestone() <<
"Setting language to " << lang << endl;
186 const char *lang_env = getenv(
"LANG" );
191 std::string lang( lang_env );
195 std::string::size_type pos = lang.find_first_of(
".@" );
197 if ( pos != std::string::npos )
199 lang = lang.substr( 0, pos );
210 if ( sym == YUIGlyph_ArrowLeft )
return (
reverseLayout() ?
"->" :
"<-" );
211 else if ( sym == YUIGlyph_ArrowRight )
return (
reverseLayout() ?
"<-" :
"->" );
212 else if ( sym == YUIGlyph_ArrowUp )
return (
"^" );
213 else if ( sym == YUIGlyph_ArrowDown )
return (
"v" );
214 else if ( sym == YUIGlyph_CheckMark )
return (
"x" );
215 else if ( sym == YUIGlyph_BulletArrowRight )
return (
"=>" );
216 else if ( sym == YUIGlyph_BulletCircle )
return (
"o" );
217 else if ( sym == YUIGlyph_BulletSquare )
return (
"[]" );
220 yuiError() <<
"Unknown glyph `" << sym << endl;
237 return (
int) ( layoutUnits + 0.5 );
251 yuiError() <<
"Not in text mode: Cannot run external program in terminal." << endl;
258 priv->applicationTitle = title;
263 return priv->applicationTitle;
268 priv->applicationIcon = icon;
272 return priv->applicationIcon;