*** empty log message ***
authorroot <root>
Fri, 30 Jul 2004 14:59:11 +0000 (14:59 +0000)
committerroot <root>
Fri, 30 Jul 2004 14:59:11 +0000 (14:59 +0000)
README.configure
autoconf/config.h.in
autoconf/configure.in
doc/rxvt.1
doc/rxvt.tbl
doc/yodl/rxvt-options.yo
reconf
src/main.C
src/rxvtcolor.C
src/rxvtcolor.h
src/rxvtlib.h.in

index d2409c91fb648f9b468f40ab22a1ca5e6c7172e5..16568c2c08e62d46d3e9eea5900527960b390f23 100644 (file)
@@ -73,6 +73,8 @@ report when a combination doesn't work, so it can be fixed. Marc Lehmann
 --enable-transparency
        add support for inheriting parent backgrounds thus giving a fake
        transparency to the term
+--enable-fading
+       add support for fading the text when focus is lost.
 --enable-tinting
        add support for tinting of transparent backgrounds.
 --enable-menubar
index 3dc48fe5b39cfaa81c03e7b841becd6e3901fc41..51321cefc31c4952db7edd0e46adc919074339e9 100644 (file)
 /* Define if you want 8 bit control sequences */
 #undef EIGHT_BIT_CONTROLS
 
+/* Define if you want faded colors when focus is lost */
+#undef OFF_FOCUS_FADING
+
 /* Define if you want your background to be tinted */
 #undef TINTING
 
index 98f15cc1318152962a78d58158c4a9be27a5c6ef..b0bb2306b941d9f44c6f367c09ce56fba9a43c6e 100644 (file)
@@ -70,6 +70,7 @@ support_frills=no
 support_linespace=no
 support_inheritpixmap=no
 support_tinting=no
+support_fading=no
 support_keepscrolling=no
 support_selectionscrolling=no
 support_menubar=no 
@@ -113,6 +114,7 @@ AC_ARG_ENABLE(everything,
     support_linespace=yes
     support_inheritpixmap=yes
     support_tinting=yes
+    support_fading=yes
     support_keepscrolling=yes
     support_selectionscrolling=yes
     support_lastlog=yes
@@ -191,6 +193,12 @@ AC_ARG_ENABLE(tinting,
     support_tinting=$enableval
   fi])
 
+AC_ARG_ENABLE(fading,
+  [  --enable-tinting        enable colors fading when off focus],
+  [if test x$enableval = xyes -o x$enableval = xno; then
+    support_fading=$enableval
+  fi])
+
 AC_ARG_ENABLE(menubar,
   [  --enable-menubar        enable menubar],
   [if test x$enableval = xyes -o x$enableval = xno; then
@@ -1175,6 +1183,9 @@ dnl# --------------------------------------------------------------------------
 if test x$support_8bitctrls = xyes; then
   AC_DEFINE(EIGHT_BIT_CONTROLS, 1, Define if you want 8 bit control sequences)
 fi
+if test x$support_fading = xyes; then
+  AC_DEFINE(OFF_FOCUS_FADING, 1, Define if you want faded colors when focus is lost)
+fi
 if test x$support_tinting = xyes; then
   AC_DEFINE(TINTING, 1, Define if you want your background to be tinted)
 fi
index fd43fc8f4f37580958211cb531c50d7a49169fbc..9c84b111f2b1000cc1628decd1a7b0f18c240386 100644 (file)
@@ -56,6 +56,8 @@ resource \fBjumpScroll\fP\&.
 Turn on/off inheriting parent window\&'s pixmap\&.  Alternative form
 is \fB-tr\fP;
 resource \fBinheritPixmap\fP\&.
+.IP "\fB-fade\fP \fInumber\fP" 
+Fade the text by the given percentage when focus is lost\&.
 .IP "\fB-tint\fP \fIcolour\fP" 
 Tint the transparent background pixmap with the given colour\&.
 .IP "\fB-bg\fP \fIcolour\fP" 
index 49661a233434b003ac3762230a0df292e24ededc..8a987330064de9cbca157c228d99c024043b532a 100644 (file)
@@ -53,6 +53,8 @@ resource \fBjumpScroll\fP\&.
 Turn on/off inheriting parent window\&'s pixmap\&.  Alternative form
 is \fB-tr\fP;
 resource \fBinheritPixmap\fP\&.
+.IP "\fB-fade\fP \fInumber\fP" 
+Fade the text by the given percentage when focus is lost\&.
 .IP "\fB-tint\fP \fIcolour\fP" 
 Tint the transparent background pixmap with the given colour\&.
 .IP "\fB-bg\fP \fIcolour\fP" 
index ea152cd3537266375c0af8a4bb5acbaa42eaeeaf..085c6380ea4a88bedba422b5c9c28e9aee305b25 100644 (file)
@@ -1,4 +1,4 @@
-COMMENT(-- $Id: rxvt-options.yo,v 1.12 2004-07-26 14:57:12 root Exp $ --)
+COMMENT(-- $Id: rxvt-options.yo,v 1.13 2004-07-30 14:59:12 root Exp $ --)
 COMMENT(----------------------------------------------------------------------)
 manpageoptions()
 
@@ -39,6 +39,8 @@ startdit()
        Turn on/off inheriting parent window's pixmap.  Alternative form
        is bf(-tr);
        resource bf(inheritPixmap).
+    dit(bf(-fade) em(number))
+       Fade the text by the given percentage when focus is lost.
     dit(bf(-tint) em(colour))
         Tint the transparent background pixmap with the given colour.
     dit(bf(-bg) em(colour))
diff --git a/reconf b/reconf
index 957cc7d64a7fff427032fafd2e2187b33142c8e6..b4d860db18d69e9636da411d3a330bee23de3050 100755 (executable)
--- a/reconf
+++ b/reconf
@@ -6,9 +6,9 @@
 ./configure --prefix=/opt/rxvt --enable-utmp \
             --enable-wtmp --enable-lastlog --enable-xim --disable-strings \
             --with-term=rxvt --disable-keepscrolling --enable-xft --enable-mousewheel \
-            --with-name=rxvt --enable-selectionscrolling \
-            --enable-frills --enable-swapscreen --enable-transparency \
+            --with-name=rxvt --enable-selectionscrolling --enable-pointer-blank \
+            --enable-frills --enable-swapscreen --enable-transparency --enable-slipwheeling \
             --with-codesets=eu,jp --enable-menubar --enable-tinting \
-            --enable-cursor-blink --enable-pointer-blank --enable-text-blink \
+            --enable-cursor-blink --enable-text-blink --enable-fading \
             --enable-plain-scroll --enable-rxvt-scroll --enable-combining \
             "$@"
index a52028f229a0eebce119bab166fc6b6790b0f16a..b5df58d11da18d49b63cdb20b96e9921769b7637 100644 (file)
@@ -244,7 +244,10 @@ rxvt_term::~rxvt_term ()
 
   // TODO: free pixcolours, colours should become part of rxvt_display
 
-  delete PixColors;
+  delete PixColorsFocused;
+#ifdef OFF_FOCUS_FADING
+  delete PixColorsUnFocused;
+#endif
 
   displays.put (display);
 
@@ -957,7 +960,7 @@ rxvt_term::set_window_color (int idx, const char *color)
         {        /* bright colors */
           i -= 8;
 # ifndef NO_BRIGHTCOLOR
-          PixColors[idx] = PixColors[minBrightCOLOR + i];
+          PixColorsFocused[idx] = PixColorsFocused[minBrightCOLOR + i];
           SET_PIXCOLOR (idx);
           goto Done;
 # endif
@@ -965,7 +968,7 @@ rxvt_term::set_window_color (int idx, const char *color)
         }
       if (i >= 0 && i <= 7)
         { /* normal colors */
-          PixColors[idx] = PixColors[minCOLOR + i];
+          PixColorsFocused[idx] = PixColorsFocused[minCOLOR + i];
           SET_PIXCOLOR (idx);
           goto Done;
         }
@@ -992,15 +995,17 @@ rxvt_term::set_window_color (int idx, const char *color)
     }
 # endif
 
-  PixColors[idx] = xcol;
+  PixColorsFocused[idx] = xcol;
   SET_PIXCOLOR (idx);
 
   /* XSetWindowAttributes attr; */
   /* Cursor cursor; */
 Done:
+#ifdef OFF_FOCUS_FADING
+  PixColorsUnFocused[idx] = PixColorsFocused[idx].fade (display, atoi (rs[Rs_fade]));
+#endif
   if (idx == Color_bg && ! (Options & Opt_transparent))
-    XSetWindowBackground (display->display, TermWin.vt,
-                         PixColors[Color_bg]);
+    XSetWindowBackground (display->display, TermWin.vt, PixColors[Color_bg]);
 
   /* handle Color_BD, scrollbar background, etc. */
 
@@ -1018,8 +1023,8 @@ rxvt_term::recolour_cursor ()
 {
   XColor xcol[2];
 
-  xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) ? PixColors[Color_pointer_fg] : PixColors[Color_fg];
-  xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) ? PixColors[Color_pointer_bg] : PixColors[Color_bg];
+  xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) ? PixColorsFocused[Color_pointer_fg] : PixColorsFocused[Color_fg];
+  xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) ? PixColorsFocused[Color_pointer_bg] : PixColorsFocused[Color_bg];
   XQueryColors (display->display, XCMAP, xcol, 2);
   XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1);
 }
index dfa3e876c1b9329e38426d460c730de778b4b274..840057153b9d26aadaa05e17f5dba4c000a29f6f 100644 (file)
@@ -409,3 +409,18 @@ rxvt_color::free (rxvt_display *display)
 #endif
 }
 
+rxvt_color
+rxvt_color::fade (rxvt_display *display, int percent)
+{
+  unsigned short cr, cg, cb;
+  rxvt_color faded;
+
+  get (display, cr, cg, cb);
+  faded.set (display,
+             cr * percent / 100,
+             cg * percent / 100,
+             cb * percent / 100);
+
+  return faded;
+}
+
index 1adedfb41dbd296523940866d93f947121fb3624..9edac7db8ac9b8a06cb3d9d0397da6e293d30b3b 100644 (file)
@@ -168,6 +168,8 @@ struct rxvt_color {
   bool set (rxvt_display *display, const char *name);
   bool set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb);
 
+  rxvt_color fade (rxvt_display *, int percent);
+
   void free (rxvt_display *display);
 };
 
index f390e217785316ee947a6fb55b43703f97f85f23..1fd0a367465d07113ebb3b0056cec6620bba42b3 100644 (file)
@@ -252,6 +252,10 @@ struct rxvt_vars {
   XSizeHints      szHint;
   rxvt_display   *display;
   rxvt_color     *PixColors;
+  rxvt_color     *PixColorsFocused;
+#ifdef OFF_FOCUS_FADING
+  rxvt_color     *PixColorsUnFocused;
+#endif
   short           numPixColors;
   Cursor          TermWin_cursor;       /* cursor for vt window */
   int             sb_shadow;    /* scrollbar shadow width                    */