new feature: alternative user interface

This commit is contained in:
Andrzej Rybczak
2009-08-12 02:08:13 +02:00
parent dbca4a80ee
commit 101f01941d
33 changed files with 428 additions and 127 deletions

View File

@@ -52,6 +52,49 @@ template <typename A, typename B> std::string StringPairToString(const std::pair
return pair.first;
}
template <typename C> void String2Buffer(const std::basic_string<C> &s, basic_buffer<C> &buf)
{
for (typename std::basic_string<C>::const_iterator it = s.begin(); it != s.end(); ++it)
{
if (*it != '$')
buf << *it;
else if (isdigit(*++it))
buf << Color(*it-'0');
else
{
switch (*it)
{
case '$':
buf << *it;
break;
case 'b':
buf << fmtBold;
break;
case 'a':
buf << fmtAltCharset;
break;
case 'r':
buf << fmtReverse;
break;
case '/':
switch (*++it)
{
case 'b':
buf << fmtBoldEnd;
break;
case 'a':
buf << fmtAltCharsetEnd;
break;
case 'r':
buf << fmtReverseEnd;
break;
}
break;
}
}
}
}
inline bool Keypressed(int in, const int *key)
{
return in == key[0] || in == key[1];
@@ -72,7 +115,10 @@ std::string ExtractTopDirectory(const std::string &);
Buffer ShowTag(const std::string &);
#ifdef _UTF8
std::basic_string<my_char_t> Scroller(const std::string &, size_t, size_t &);
#endif // _UTF8
std::basic_string<my_char_t> Scroller(const std::basic_string<my_char_t> &, size_t, size_t &);
#ifdef HAVE_CURL_CURL_H
size_t write_data(char *, size_t, size_t, void *);