Enlightenment CVS committal

Author  : mej
Project : eterm
Module  : Eterm

Dir     : eterm/Eterm/src


Modified Files:
      Tag: ETERM-0_10
        feature.h options.c options.h screen.c screen.h term.c term.h 
        windows.c 


Log Message:
Mon Oct  6 20:44:29 2003                        Michael Jennings (mej)

Forgot to merge last time.

===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/feature.h,v
retrieving revision 1.32.2.2
retrieving revision 1.32.2.3
diff -u -3 -r1.32.2.2 -r1.32.2.3
--- feature.h   3 Mar 2003 06:20:48 -0000       1.32.2.2
+++ feature.h   7 Oct 2003 00:48:28 -0000       1.32.2.3
@@ -100,10 +100,6 @@
    config files and pixmaps */
 #define PATH_ENV       "ETERMPATH"
 
-/* Disable simulation of bold font using an "overstrike" technique.  This technique
- has been known to cause pixel droppings.  See also FORCE_CLEAR_CHARS. */
-/* #define NO_BOLDOVERSTRIKE */
-
 /* Disable the secondary screen ("\E[?47h" / "\E[?47l") */
 /* #define NO_SECONDARY_SCREEN */
 
@@ -112,7 +108,7 @@
 
 /* This will force clearing of characters before writing new ones on top of
  * them. This is experimental - added in order to try and fix pixel dropping
- * problems some people have had. See also NO_BOLDOVERSTRIKE. */
+ * problems some people have had. */
 /*# define FORCE_CLEAR_CHARS*/
 
 /* The command through which to pipe print-screen requests */
===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/options.c,v
retrieving revision 1.102.2.11
retrieving revision 1.102.2.12
diff -u -3 -r1.102.2.11 -r1.102.2.12
--- options.c   24 Aug 2003 15:16:44 -0000      1.102.2.11
+++ options.c   7 Oct 2003 00:48:28 -0000       1.102.2.12
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-static const char cvs_ident[] = "$Id: options.c,v 1.102.2.11 2003/08/24 15:16:44 mej 
Exp $";
+static const char cvs_ident[] = "$Id: options.c,v 1.102.2.12 2003/10/07 00:48:28 mej 
Exp $";
 
 #include "config.h"
 #include "feature.h"
@@ -97,7 +97,8 @@
 #endif
 
 unsigned long eterm_options = (ETERM_OPTIONS_SCROLLBAR | 
ETERM_OPTIONS_SELECT_TRAILING_SPACES);
-unsigned long vt_options = (VT_OPTIONS_SECONDARY_SCREEN);
+unsigned long vt_options = (VT_OPTIONS_SECONDARY_SCREEN | VT_OPTIONS_OVERSTRIKE_BOLD 
| VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND |
+                            VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND | 
VT_OPTIONS_COLORS_SUPPRESS_BOLD);
 unsigned long image_options = 0;
 char *theme_dir = NULL, *user_dir = NULL;
 char **rs_exec_args = NULL;     /* Args to exec (-e or --exec) */
@@ -195,7 +196,6 @@
     SPIFOPT_STR_LONG("color5", "color 5", rs_color[minColor + 5]),
     SPIFOPT_STR_LONG("color6", "color 6", rs_color[minColor + 6]),
     SPIFOPT_STR_LONG("color7", "color 7", rs_color[minColor + 7]),
-#ifndef NO_BRIGHTCOLOR
     SPIFOPT_STR_LONG("color8", "color 8", rs_color[minBright]),
     SPIFOPT_STR_LONG("color9", "color 9", rs_color[minBright + 1]),
     SPIFOPT_STR_LONG("color10", "color 10", rs_color[minBright + 2]),
@@ -204,7 +204,6 @@
     SPIFOPT_STR_LONG("color13", "color 13", rs_color[minBright + 5]),
     SPIFOPT_STR_LONG("color14", "color 14", rs_color[minBright + 6]),
     SPIFOPT_STR_LONG("color15", "color 15", rs_color[minBright + 7]),
-#endif                          /* NO_BRIGHTCOLOR */
 #ifndef NO_BOLDUNDERLINE
     SPIFOPT_STR_LONG("colorBD", "bold color", rs_color[colorBD]),
     SPIFOPT_STR_LONG("colorUL", "underline color", rs_color[colorUL]),
@@ -288,6 +287,10 @@
     SPIFOPT_BOOL_LONG("scrollbar-floating", "display the scrollbar with no trough", 
eterm_options, ETERM_OPTIONS_SCROLLBAR_FLOATING),
     SPIFOPT_BOOL_LONG("scrollbar-popup", "popup the scrollbar only when focused", 
eterm_options, ETERM_OPTIONS_SCROLLBAR_POPUP),
     SPIFOPT_BOOL('x', "borderless", "force Eterm to have no borders", eterm_options, 
ETERM_OPTIONS_BORDERLESS),
+    SPIFOPT_BOOL_LONG("overstrike-bold", "simulate bold by overstriking characters", 
vt_options, VT_OPTIONS_OVERSTRIKE_BOLD),
+    SPIFOPT_BOOL_LONG("bold-brightens-foreground", "\"bold\" attribute brightens 
foreground color", vt_options, VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND),
+    SPIFOPT_BOOL_LONG("blink-brightens-background", "\"blink\" attribute brightens 
background color", vt_options, VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND),
+    SPIFOPT_BOOL_LONG("colors-suppress-bold", "do not make ANSI colors 0-16 bold", 
vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD),
 #ifndef NO_MAPALERT
 # ifdef MAPALERT_OPTION
     SPIFOPT_BOOL('m', "map-alert", "uniconify on beep", vt_options, 
VT_OPTIONS_MAP_ALERT),
@@ -510,21 +513,11 @@
 #else
     printf(" -NO_CURSORCOLOR");
 #endif
-#ifdef NO_BRIGHTCOLOR
-    printf(" +NO_BRIGHTCOLOR");
-#else
-    printf(" -NO_BRIGHTCOLOR");
-#endif
 #ifdef NO_BOLDUNDERLINE
     printf(" +NO_BOLDUNDERLINE");
 #else
     printf(" -NO_BOLDUNDERLINE");
 #endif
-#ifdef NO_BOLDOVERSTRIKE
-    printf(" +NO_BOLDOVERSTRIKE");
-#else
-    printf(" -NO_BOLDOVERSTRIKE");
-#endif
 #ifdef NO_BOLDFONT
     printf(" +NO_BOLDFONT");
 #else
@@ -1239,6 +1232,35 @@
         } else {
             BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_RESIZE_GRAVITY);
         }
+
+    } else if (!BEG_STRCASECMP(buff, "overstrike_bold ")) {
+        if (bool_val) {
+            BITFIELD_SET(vt_options, VT_OPTIONS_OVERSTRIKE_BOLD);
+        } else {
+            BITFIELD_CLEAR(vt_options, VT_OPTIONS_OVERSTRIKE_BOLD);
+        }
+
+    } else if (!BEG_STRCASECMP(buff, "bold_brightens_foreground ")) {
+        if (bool_val) {
+            BITFIELD_SET(vt_options, VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND);
+        } else {
+            BITFIELD_CLEAR(vt_options, VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND);
+        }
+
+    } else if (!BEG_STRCASECMP(buff, "blink_brightens_background ")) {
+        if (bool_val) {
+            BITFIELD_SET(vt_options, VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND);
+        } else {
+            BITFIELD_CLEAR(vt_options, VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND);
+        }
+
+    } else if (!BEG_STRCASECMP(buff, "colors_suppress_bold ")) {
+        if (bool_val) {
+            BITFIELD_SET(vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD);
+        } else {
+            BITFIELD_CLEAR(vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD);
+        }
+
     } else {
         print_error("Parse error in file %s, line %lu:  Attribute \"%s\" is not valid 
within context toggles\n", file_peek_path(),
                     file_peek_line(), buff);
@@ -2483,9 +2505,7 @@
 #ifdef PIXMAP_SUPPORT
     rs_path = NULL;
 #endif
-#ifndef NO_BRIGHTCOLOR
     colorfgbg = DEFAULT_RSTYLE;
-#endif
 
     /* Font stuff. */
     MEMSET(rs_font, 0, sizeof(char *) * NFONTS);
===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/options.h,v
retrieving revision 1.36.2.6
retrieving revision 1.36.2.7
diff -u -3 -r1.36.2.6 -r1.36.2.7
--- options.h   24 Aug 2003 15:16:44 -0000      1.36.2.6
+++ options.h   7 Oct 2003 00:48:28 -0000       1.36.2.7
@@ -38,6 +38,10 @@
 # define VT_OPTIONS_REPORT_AS_KEYSYMS             (1LU <<  7)
 # define VT_OPTIONS_PROPORTIONAL                  (1LU <<  8)
 # define VT_OPTIONS_SECONDARY_SCREEN              (1LU <<  9)
+# define VT_OPTIONS_OVERSTRIKE_BOLD               (1LU << 10)
+# define VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND     (1LU << 11)
+# define VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND    (1LU << 12)
+# define VT_OPTIONS_COLORS_SUPPRESS_BOLD          (1LU << 13)
 
 # define ETERM_OPTIONS_LOGIN_SHELL                (1LU <<  0)
 # define ETERM_OPTIONS_ICONIC                     (1LU <<  1)
===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/screen.c,v
retrieving revision 1.59.2.6
retrieving revision 1.59.2.7
diff -u -3 -r1.59.2.6 -r1.59.2.7
--- screen.c    24 Aug 2003 15:16:44 -0000      1.59.2.6
+++ screen.c    7 Oct 2003 00:48:28 -0000       1.59.2.7
@@ -3,7 +3,7 @@
  *
  */
 
-static const char cvs_ident[] = "$Id: screen.c,v 1.59.2.6 2003/08/24 15:16:44 mej Exp 
$";
+static const char cvs_ident[] = "$Id: screen.c,v 1.59.2.7 2003/10/07 00:48:28 mej Exp 
$";
 
 #include "config.h"
 #include "feature.h"
@@ -485,11 +485,20 @@
                   break;
             }
         } else {
-#ifndef NO_BRIGHTCOLOR
             if ((rstyle & Intensity) && color >= minColor && color <= maxColor) {
-                color += (minBright - minColor);
+                switch (Intensity) {
+                    case RS_Bold:
+                        if (BITFIELD_IS_SET(vt_options, 
VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND)) {
+                            color += (minBright - minColor);
+                        }
+                        break;
+                    case RS_Blink:
+                        if (BITFIELD_IS_SET(vt_options, 
VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND)) {
+                            color += (minBright - minColor);
+                        }
+                        break;
+                }
             }
-#endif
         }
     }
     switch (Intensity) {
@@ -520,7 +529,6 @@
               if (rvideo)
                   rstyle &= ~RS_RVid;
               break;
-#ifndef NO_BRIGHTCOLOR
           case RS_Bold:
               color = GET_FGCOLOR(rstyle);
               scr_color((color == fgColor ? GET_FGCOLOR(colorfgbg) : color), RS_Bold);
@@ -529,7 +537,6 @@
               color = GET_BGCOLOR(rstyle);
               scr_color((color == bgColor ? GET_BGCOLOR(colorfgbg) : color), 
RS_Blink);
               break;
-#endif
         }
     } else {
 /* B: Unset style */
@@ -543,7 +550,6 @@
               if (rvideo)
                   rstyle |= RS_RVid;
               break;
-#ifndef NO_BRIGHTCOLOR
           case RS_Bold:
               color = GET_FGCOLOR(rstyle);
               if (color >= minBright && color <= maxBright) {
@@ -560,7 +566,6 @@
                       scr_color(restoreBG, RS_Blink);
               }
               break;
-#endif
         }
     }
 }
@@ -1942,12 +1947,10 @@
                 }
                 DRAW_STRING(draw_string, xpixel, ypixel, buffer, 1);
                 UPDATE_BOX(xpixel, ypixel - ascent, xpixel + Width2Pixel(1), ypixel + 
Height2Pixel(1));
-#ifndef NO_BOLDOVERSTRIKE
-                if (MONO_BOLD(rend)) {
+                if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_OVERSTRIKE_BOLD) && 
MONO_BOLD(rend)) {
                     DRAW_STRING(draw_string, xpixel + 1, ypixel, buffer, 1);
                     UPDATE_BOX(xpixel + 1, ypixel - ascent, xpixel + 1 + 
Width2Pixel(1), ypixel + Height2Pixel(1));
                 }
-#endif
             } else {
 #ifdef PIXMAP_SUPPORT
                 if (background_is_pixmap() && (back == bgColor)) {
@@ -2042,12 +2045,10 @@
             }
 
             /* do the convoluted bold overstrike */
-#ifndef NO_BOLDOVERSTRIKE
-            if (MONO_BOLD(rend)) {
+            if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_OVERSTRIKE_BOLD) && 
MONO_BOLD(rend)) {
                 DRAW_STRING(draw_string, xpixel + 1, ypixel, buffer, wlen);
                 UPDATE_BOX(xpixel + 1, ypixel - ascent, xpixel + 1 + 
Width2Pixel(wlen), ypixel + Height2Pixel(1));
             }
-#endif
 
             if (rend & RS_Uline) {
                 if (descent > 1) {
@@ -3340,21 +3341,17 @@
     fprintf(stderr, "): ");
 
     color = GET_FGCOLOR(rstyle);
-#ifndef NO_BRIGHTCOLOR
     if (color >= minBright && color <= maxBright) {
         color -= (minBright - minColor);
         fprintf(stderr, "bright ");
     }
-#endif
     fprintf(stderr, "%s on ", name[color]);
 
     color = GET_BGCOLOR(rstyle);
-#ifndef NO_BRIGHTCOLOR
     if (color >= minBright && color <= maxBright) {
         color -= (minBright - minColor);
         fprintf(stderr, "bright ");
     }
-#endif
     fprintf(stderr, "%s\n", name[color]);
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/screen.h,v
retrieving revision 1.20.2.4
retrieving revision 1.20.2.5
diff -u -3 -r1.20.2.4 -r1.20.2.5
--- screen.h    24 Aug 2003 15:16:45 -0000      1.20.2.4
+++ screen.h    7 Oct 2003 00:48:29 -0000       1.20.2.5
@@ -60,11 +60,10 @@
 #define ERASE_ROWS(row, num)  do {XFillRectangle(Xdisplay, draw_buffer, TermWin.gc, 
Col2Pixel(0), Row2Pixel(row), TERM_WINDOW_GET_WIDTH(), Height2Pixel(num)); \
                                   if (buffer_pixmap) {XClearArea(Xdisplay, 
TermWin.vt, Col2Pixel(0), Row2Pixel(row), TERM_WINDOW_GET_WIDTH(), Height2Pixel(num), 
0);}} while (0)
 #define DRAW_STRING(Func, x, y, str, len)  Func(Xdisplay, draw_buffer, TermWin.gc, x, 
y, str, len)
-#ifndef NO_BRIGHTCOLOR
-# define MONO_BOLD(x)  (((x) & RS_Bold) && fore == fgColor)
-#else
-# define MONO_BOLD(x)  ((x) & (RS_Bold|RS_Blink))
-#endif
+
+/* Make bold if bold flag is set and either we're drawing the foreground color or 
we're not suppressing bold.
+   In other words, the foreground color can always be bolded, but other colors can't 
if bold is suppressed. */
+#define MONO_BOLD(x) (((x) & RS_Bold) && (!BITFIELD_IS_SET(vt_options, 
VT_OPTIONS_COLORS_SUPPRESS_BOLD) || fore == fgColor))
 
 /* Screen refresh methods */
 #define NO_REFRESH              0       /* Window not visible at all!        */
@@ -224,9 +223,7 @@
 } selection_t;
 
 /************ Variables ************/
-#ifndef NO_BRIGHTCOLOR
 extern unsigned int colorfgbg;
-#endif
 extern unsigned char refresh_all;
 #ifdef MULTI_CHARSET
 extern encoding_t encoding_method;
===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/term.c,v
retrieving revision 1.78.2.7
retrieving revision 1.78.2.8
diff -u -3 -r1.78.2.7 -r1.78.2.8
--- term.c      24 Aug 2003 15:16:45 -0000      1.78.2.7
+++ term.c      7 Oct 2003 00:48:29 -0000       1.78.2.8
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-static const char cvs_ident[] = "$Id: term.c,v 1.78.2.7 2003/08/24 15:16:45 mej Exp 
$";
+static const char cvs_ident[] = "$Id: term.c,v 1.78.2.8 2003/10/07 00:48:29 mej Exp 
$";
 
 #include "config.h"
 #include "feature.h"
@@ -60,7 +60,6 @@
 char *def_colorName[] = {
     "rgb:aa/aa/aa", "rgb:0/0/0",        /* fg/bg */
     "rgb:0/0/0",                /* 0: black             (#000000) */
-#ifndef NO_BRIGHTCOLOR
     /* low-intensity colors */
     "rgb:cc/00/00",             /* 1: red     */
     "rgb:00/cc/00",             /* 2: green   */
@@ -71,7 +70,6 @@
     "rgb:aa/aa/aa",             /* 7: white   */
     /* high-intensity colors */
     "rgb:33/33/33",             /* 8: bright black */
-#endif                          /* NO_BRIGHTCOLOR */
     "rgb:ff/00/00",             /* 1/9:  bright red     */
     "rgb:00/ff/00",             /* 2/10: bright green   */
     "rgb:ff/ff/00",             /* 3/11: bright yellow  */
@@ -1689,7 +1687,6 @@
 }
 
 /* find if fg/bg matches any of the normal (low-intensity) colors */
-#ifndef NO_BRIGHTCOLOR
 void
 set_colorfgbg(void)
 {
@@ -1748,7 +1745,6 @@
             colorfgbg = SET_BGCOLOR(colorfgbg, i);
     }
 }
-#endif /* NO_BRIGHTCOLOR */
 
 void
 set_title(const char *str)
===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/term.h,v
retrieving revision 1.21.2.3
retrieving revision 1.21.2.4
diff -u -3 -r1.21.2.3 -r1.21.2.4
--- term.h      3 Mar 2003 06:21:01 -0000       1.21.2.3
+++ term.h      7 Oct 2003 00:48:29 -0000       1.21.2.4
@@ -99,10 +99,6 @@
     Magenta3Color,
     Cyan3Color,
     maxColor,                          /* minColor + 7 */
-# ifdef NO_BRIGHTCOLOR
-    WhiteColor = maxColor,
-    maxBright = maxColor,
-# else
     AntiqueWhiteColor = maxColor,
     minBright,                         /* maxColor + 1 */
     Grey25Color = minBright,
@@ -114,7 +110,6 @@
     CyanColor,
     maxBright,                         /* minBright + 7 */
     WhiteColor = maxBright,
-# endif
 # ifndef NO_CURSORCOLOR
     cursorColor,
     cursorColor2,
@@ -186,11 +181,7 @@
 extern void process_window_mode(unsigned int, int []);
 extern void process_terminal_mode(int, int, unsigned int, int []);
 extern void process_sgr_mode(unsigned int, int []);
-#ifndef NO_BRIGHTCOLOR
 extern void set_colorfgbg(void);
-#else
-# define set_colorfgbg() ((void)0)
-#endif /* NO_BRIGHTCOLOR */
 extern void set_title(const char *);
 extern void set_icon_name(const char *);
 extern void append_to_title(const char *);
===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/src/windows.c,v
retrieving revision 1.51.2.5
retrieving revision 1.51.2.6
diff -u -3 -r1.51.2.5 -r1.51.2.6
--- windows.c   24 Aug 2003 15:16:45 -0000      1.51.2.5
+++ windows.c   7 Oct 2003 00:48:29 -0000       1.51.2.6
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-static const char cvs_ident[] = "$Id: windows.c,v 1.51.2.5 2003/08/24 15:16:45 mej 
Exp $";
+static const char cvs_ident[] = "$Id: windows.c,v 1.51.2.6 2003/10/07 00:48:29 mej 
Exp $";
 
 #include "config.h"
 #include "feature.h"
@@ -692,14 +692,8 @@
         i = atoi(color);
         if (i >= 8 && i <= 15) {        /* bright colors */
             i -= 8;
-# ifndef NO_BRIGHTCOLOR
             PixColors[idx] = PixColors[minBright + i];
-# endif
-        }
-# ifndef NO_BRIGHTCOLOR
-        else
-# endif
-        if (i >= 0 && i <= 7) { /* normal colors */
+        } else if (i >= 0 && i <= 7) { /* normal colors */
             PixColors[idx] = PixColors[minColor + i];
         } else {
             print_warning("Color index %d is invalid.\n", i);




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to