Hello,


I have made a color invert patch for rxvt. You can select the inverse
color now.

I attached the patch for version 2.6.3 and 2.7.3.


Ciao
 -tom-

  ___ __
    _/ / ___  ____
   /  _// _ \/    \    T h o m a s   W o e r n e r     <[EMAIL PROTECTED]>
   / /_/ // / / / /
   \__/\___/_/_/_/____________________________________________________________

diff -ur rxvt-2.6.3.old/src/feature.h rxvt-2.6.3/src/feature.h
--- rxvt-2.6.3.old/src/feature.h        Wed Jul  5 09:26:17 2000
+++ rxvt-2.6.3/src/feature.h    Sun Aug 13 16:53:40 2000
@@ -57,6 +57,11 @@
 /* #define NO_BOLDUNDERLINE */
 
 /*
+ * Disable colour for reverse mode
+ */
+/* #define NO_REVERSE */
+
+/*
  * Disable using simulated bold using overstrike.  You can also turn off
  * overstrike just for multi char fonts
  * Note: NO_BOLDOVERSTRIKE implies NO_BOLDOVERSTRIKE_MULTI
diff -ur rxvt-2.6.3.old/src/main.c rxvt-2.6.3/src/main.c
--- rxvt-2.6.3.old/src/main.c   Sun Jun  4 08:47:32 2000
+++ rxvt-2.6.3/src/main.c       Sun Aug 13 16:53:43 2000
@@ -71,6 +71,9 @@
   , NULL,                      /* Color_BD                       */
     NULL                       /* Color_UL                       */
 #endif                         /* ! NO_BOLDUNDERLINE */
+#ifndef NO_REVERSE
+  , NULL                       /* Color_IV                       */
+#endif                         /* ! NO_REVERSE */
 #ifdef KEEP_SCROLLCOLOR
   , COLOR_SCROLLBAR,
     COLOR_SCROLLTROUGH
@@ -1278,6 +1281,9 @@
     color_aliases(Color_BD);
     color_aliases(Color_UL);
 #endif                         /* NO_BOLDUNDERLINE */
+#ifndef NO_REVERSE
+    color_aliases(Color_IV);
+#endif                         /* NO_REVERSE */
 
     return cmd_argv;
 }
diff -ur rxvt-2.6.3.old/src/rxvt.h rxvt-2.6.3/src/rxvt.h
--- rxvt-2.6.3.old/src/rxvt.h   Mon Apr 10 04:32:19 2000
+++ rxvt-2.6.3/src/rxvt.h       Sun Aug 13 16:53:46 2000
@@ -532,6 +532,9 @@
     Color_BD,
     Color_UL,
 #endif
+#ifndef NO_REVERSE
+    Color_IV,
+#endif
 #ifdef KEEP_SCROLLCOLOR
     Color_scroll,
     Color_trough,
diff -ur rxvt-2.6.3.old/src/screen.c rxvt-2.6.3/src/screen.c
--- rxvt-2.6.3.old/src/screen.c Fri Jul 14 05:29:29 2000
+++ rxvt-2.6.3/src/screen.c     Sun Aug 13 16:53:46 2000
@@ -2475,8 +2475,21 @@
                        buffer[i] = 0x1e;
                break;
            }
-           if (rvid)
-               SWAP_IT(fore, back, i);
+
+           if (rvid) {
+#ifndef NO_REVERSE
+               if (Xdepth > 2 && rs[Rs_color + Color_IV]
+                   && PixColors[fore] != PixColors[Color_cursor]
+                   && PixColors[fore] != PixColors[Color_IV]
+                   && PixColors[back] != PixColors[Color_IV]) {
+                   fore = back;
+                   back = Color_IV;
+               }
+               else
+#endif
+                   SWAP_IT(fore, back, i);
+            }
+
            if (back != Color_bg) {
                gcvalue.background = PixColors[back];
                gcmask |= GCBackground;
diff -ur rxvt-2.6.3.old/src/xdefaults.c rxvt-2.6.3/src/xdefaults.c
--- rxvt-2.6.3.old/src/xdefaults.c      Wed Jul  5 08:51:45 2000
+++ rxvt-2.6.3/src/xdefaults.c  Sun Aug 13 16:53:46 2000
@@ -146,6 +146,9 @@
     RSTRG(Rs_color + Color_BD, "colorBD", "color"),
     RSTRG(Rs_color + Color_UL, "colorUL", "color"),
 #endif                         /* NO_BOLDUNDERLINE */
+#ifndef NO_REVERSE
+    RSTRG(Rs_color + Color_IV, "colorIV", "color"),
+#endif
 #ifdef KEEP_SCROLLCOLOR
     RSTRG(Rs_color + Color_scroll, "scrollColor", "color"),
     RSTRG(Rs_color + Color_trough, "troughColor", "color"),
diff -urB rxvt-2.7.3.old/src/feature.h rxvt-2.7.3/src/feature.h
--- rxvt-2.7.3.old/src/feature.h        Fri Jan 14 02:26:24 2000
+++ rxvt-2.7.3/src/feature.h    Sun Aug 13 17:25:04 2000
@@ -51,6 +51,11 @@
 /* #define NO_BOLDUNDERLINE */
 
 /*
+ * Disable colour for reverse mode
+ */
+/* #define NO_REVERSE */
+
+/*
  * Disable using simulated bold using overstrike.  You can also turn off
  * overstrike just for multi char fonts
  * Note: NO_BOLDOVERSTRIKE implies NO_BOLDOVERSTRIKE_MULTI
diff -urB rxvt-2.7.3.old/src/init.c rxvt-2.7.3/src/init.c
--- rxvt-2.7.3.old/src/init.c   Sun Mar 26 09:47:01 2000
+++ rxvt-2.7.3/src/init.c       Sun Aug 13 17:26:50 2000
@@ -71,6 +71,9 @@
   , NULL,                      /* Color_BD                       */
     NULL                       /* Color_UL                       */
 #endif                         /* ! NO_BOLDUNDERLINE */
+#ifndef NO_REVERSE
+  , NULL                        /* Color_IV                       */
+#endif                                /* ! NO_REVERSE */
 #ifdef KEEP_SCROLLCOLOR
   , COLOR_SCROLLBAR,
     COLOR_SCROLLTROUGH
@@ -315,6 +318,9 @@
     color_aliases(Color_BD);
     color_aliases(Color_UL);
 #endif                         /* NO_BOLDUNDERLINE */
+#ifndef NO_REVERSE
+    color_aliases(Color_IV);
+#endif                                /* NO_REVERSE */
 
     return cmd_argv;
 }
diff -urB rxvt-2.7.3.old/src/rxvt.h rxvt-2.7.3/src/rxvt.h
--- rxvt-2.7.3.old/src/rxvt.h   Sun Feb 27 05:57:52 2000
+++ rxvt-2.7.3/src/rxvt.h       Sun Aug 13 17:25:04 2000
@@ -514,6 +514,9 @@
     Color_BD,
     Color_UL,
 #endif
+#ifndef NO_REVERSE
+    Color_IV,
+#endif
 #ifdef KEEP_SCROLLCOLOR
     Color_scroll,
     Color_trough,
diff -urB rxvt-2.7.3.old/src/screen.c rxvt-2.7.3/src/screen.c
--- rxvt-2.7.3.old/src/screen.c Wed Feb 23 06:13:36 2000
+++ rxvt-2.7.3/src/screen.c     Sun Aug 13 17:31:38 2000
@@ -2496,8 +2496,21 @@
                        buffer[i] = 0x1e;
                break;
            }
-           if (rvid)
-               SWAP_IT(fore, back, i);
+
+           if (rvid) {
+#ifndef NO_REVERSE
+               if (Xdepth > 2 && rs.color[Color_IV]
+                   && PixColors[fore] != PixColors[Color_cursor]
+                   && PixColors[fore] != PixColors[Color_IV]
+                   && PixColors[back] != PixColors[Color_IV]) {
+                   fore = back;
+                   back = Color_IV;
+               }
+               else
+#endif
+                   SWAP_IT(fore, back, i);
+            }
+
            if (back != Color_bg) {
                gcvalue.background = PixColors[back];
                gcmask |= GCBackground;
diff -urB rxvt-2.7.3.old/src/xdefaults.c rxvt-2.7.3/src/xdefaults.c
--- rxvt-2.7.3.old/src/xdefaults.c      Sat Mar 11 06:14:50 2000
+++ rxvt-2.7.3/src/xdefaults.c  Sun Aug 13 17:32:13 2000
@@ -144,6 +144,9 @@
     RSTRG(rs.color[Color_BD], "colorBD", "color"),
     RSTRG(rs.color[Color_UL], "colorUL", "color"),
 #endif                         /* NO_BOLDUNDERLINE */
+#ifndef NO_REVERSE
+    RSTRG(rs.color[Color_IV], "colorIV", "color"),
+#endif
 #ifdef KEEP_SCROLLCOLOR
     RSTRG(rs.color[Color_scroll], "scrollColor", "color"),
     RSTRG(rs.color[Color_trough], "troughColor", "color"),

Reply via email to