public:
virtual Attribute *normal(void) const { return new AnsiAttribute("0m"); }
virtual Attribute *bold(void) const { return new AnsiAttribute("1m"); }
+ /* Italic is not widely supported, or worse, implemented with a reverse */
+#if 0
virtual Attribute *italic(void) const { return new AnsiAttribute("3m"); }
+#endif
virtual Attribute *strike(void) const { return new AnsiAttribute("9m"); }
virtual Attribute *color(Color c) const {
static const char *color_escapes[] = {
inline Formatter *defaultFormatter(bool color = true) {
if (color) {
#ifdef _WIN32
+ // http://wiki.winehq.org/DeveloperFaq#detect-wine
+ static HMODULE hNtDll = NULL;
+ static bool bWine = false;
+ if (!hNtDll) {
+ hNtDll = LoadLibraryA("ntdll");
+ if (hNtDll) {
+ bWine = GetProcAddress(hNtDll, "wine_get_version") != NULL;
+ }
+ }
+ if (bWine) {
+ return new AnsiFormatter;
+ }
return new WindowsFormatter;
#else
return new AnsiFormatter;