# HG changeset patch # User arpi # Date 1030805640 0 # Node ID 9a123ba671fd0f60b72ae9d8157516bd28502775 # Parent 9e201175b78c5b3819b0f5ce9492c275c635018d - warnings enabled for GUI mode - color mode (color depends on msg level), disabled by default diff -r 9e201175b78c -r 9a123ba671fd mp_msg.c --- a/mp_msg.c Sat Aug 31 14:28:28 2002 +0000 +++ b/mp_msg.c Sat Aug 31 14:54:00 2002 +0000 @@ -1,3 +1,5 @@ + +//#define MSG_USE_COLORS #include #include @@ -67,18 +69,34 @@ case MSGL_ERR: gtkMessageBox(GTK_MB_ERROR|GTK_MB_SIMPLE, tmp); break; -// case MSGL_WARN: -// gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, tmp); -// break; + case MSGL_WARN: + gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, tmp); + break; } } #endif +#ifdef MSG_USE_COLORS +#if 1 + { int c; + static int flag=1; + if(flag) + for(c=0;c<16;c++) + printf("\033[%d;3%dm*** COLOR TEST %d ***\n",(c>7),c&7,c); + flag=0; + } +#endif + { unsigned char v_colors[10]={9,9,11,14,15,7,6,5,5,5}; + int c=v_colors[(x & 255)]; + fprintf(((x & 255) <= MSGL_WARN)?stderr:stdout, "\033[%d;3%dm",(c>7),c&7); + } +#endif if ((x & 255) <= MSGL_WARN){ fprintf(stderr, "%s", tmp);fflush(stderr); } else { printf("%s", tmp);fflush(stdout); } + #else va_list va; if((x&255)>mp_msg_levels[x>>8]) return; // do not display