Ticket #20175: patch-urxvt-8.2-256color.diff

File patch-urxvt-8.2-256color.diff, 10.9 KB (added by dsturnbull@…, 15 years ago)

p0 version of the included xterm colours patch

  • configure.ac

    diff -ru ../y/configure.ac ./configure.ac
    old new  
    9090support_mousewheel=yes
    9191support_mouseslipwheel=yes
    9292support_text_blink=yes
     93support_xterm_colors=88
    9394support_pointer_blank=yes
    9495support_scroll_rxvt=yes
    9596support_scroll_next=yes
     
    124125       support_mousewheel=no
    125126       support_mouseslipwheel=no
    126127       support_text_blink=no
     128       support_xterm_colors=no
    127129       support_pointer_blank=no
    128130       support_scroll_rxvt=no
    129131       support_scroll_next=no
     
    152154       support_mousewheel=yes
    153155       support_mouseslipwheel=yes
    154156       support_text_blink=yes
     157       support_xterm_colors=88
    155158       support_pointer_blank=yes
    156159       support_scroll_rxvt=yes
    157160       support_scroll_next=yes
     
    388391    support_text_blink=$enableval
    389392  fi])
    390393
     394AC_ARG_ENABLE(xterm-colors,
     395  [  --enable-xterm-colors     enable Xterm 88 or 256 color model],
     396  [if test x$enableval = x88 -o x$enableval = x256 -o x$enableval = xno; then
     397    support_xterm_colors=$enableval
     398  fi])
     399
    391400AC_ARG_ENABLE(pointer-blank,
    392401  [  --enable-pointer-blank  enable pointer blank when typing or inactive pointer],
    393402  [if test x$enableval = xyes -o x$enableval = xno; then
     
    660669if test x$support_text_blink = xyes; then
    661670  AC_DEFINE(TEXT_BLINK, 1, Define if you want blinking text support)
    662671fi
     672if test x$support_xterm_colors = x88 -o x$support_xterm_colors = x256; then
     673  AC_DEFINE_UNQUOTED(XTERM_COLORS, $support_xterm_colors, Set to 88 or 256 depending on Xterm color cube you want)
     674fi
    663675if test x$support_unicode3 = xyes; then
    664676  AC_DEFINE(UNICODE_3, 1, Define if you want to represent unicode characters outside plane 0)
    665677fi
     
    761773if test x$terminfo != x; then
    762774  echo "  set TERMINFO to:            $terminfo"
    763775fi
     776if test x$support_xterm_colors != xno; then
     777  echo "  Xterm color cube:           $support_xterm_colors"
     778fi
    764779echo "  default resource name:      $RESNAME"
    765780echo "  resource class:             $RESCLASS"
    766781if test x$RESFALLBACK != x; then
  • src/feature.h

    diff -ru ../y/src/feature.h ./src/feature.h
    old new  
    3434# define XAPPLOADDIRLOCALE      X11LIBDIR "/%s/app-defaults"
    3535#endif
    3636
     37#include "../config.h"
     38
    3739/*-------------------------------SECURITY-------------------------------*/
    3840
    3941/*
     
    7880/*
    7981 * Make colours match xterm colours instead of `traditional' rxvt colours
    8082 */
    81 #define XTERM_COLORS
     83#ifndef XTERM_COLORS
     84#define XTERM_COLORS 256
     85#endif
    8286
    8387/*
    8488 * Disable separate colours for bold, underline and reverse video
  • src/init.C

    diff -ru ../y/src/init.C ./src/init.C
    old new  
    176176    "rgb:00/ff/ff",             // 6/14: bright cyan    (Cyan)
    177177    "rgb:ff/ff/ff",             // 7/15: bright white   (White)
    178178
     179#if XTERM_COLORS == 88
    179180    // 88 xterm colours
    180181    "rgb:00/00/00",
    181182    "rgb:00/00/8b",
     
    249250    "rgb:b9/b9/b9",
    250251    "rgb:d0/d0/d0",
    251252    "rgb:e7/e7/e7",
     253#elif XTERM_COLORS == 256
     254    // 256 xterm colours
     255    "rgb:00/00/00",
     256    "rgb:00/00/5f",
     257    "rgb:00/00/87",
     258    "rgb:00/00/af",
     259    "rgb:00/00/d7",
     260    "rgb:00/00/ff",
     261    "rgb:00/5f/00",
     262    "rgb:00/5f/5f",
     263    "rgb:00/5f/87",
     264    "rgb:00/5f/af",
     265    "rgb:00/5f/d7",
     266    "rgb:00/5f/ff",
     267    "rgb:00/87/00",
     268    "rgb:00/87/5f",
     269    "rgb:00/87/87",
     270    "rgb:00/87/af",
     271    "rgb:00/87/d7",
     272    "rgb:00/87/ff",
     273    "rgb:00/af/00",
     274    "rgb:00/af/5f",
     275    "rgb:00/af/87",
     276    "rgb:00/af/af",
     277    "rgb:00/af/d7",
     278    "rgb:00/af/ff",
     279    "rgb:00/d7/00",
     280    "rgb:00/d7/5f",
     281    "rgb:00/d7/87",
     282    "rgb:00/d7/af",
     283    "rgb:00/d7/d7",
     284    "rgb:00/d7/ff",
     285    "rgb:00/ff/00",
     286    "rgb:00/ff/5f",
     287    "rgb:00/ff/87",
     288    "rgb:00/ff/af",
     289    "rgb:00/ff/d7",
     290    "rgb:00/ff/ff",
     291    "rgb:5f/00/00",
     292    "rgb:5f/00/5f",
     293    "rgb:5f/00/87",
     294    "rgb:5f/00/af",
     295    "rgb:5f/00/d7",
     296    "rgb:5f/00/ff",
     297    "rgb:5f/5f/00",
     298    "rgb:5f/5f/5f",
     299    "rgb:5f/5f/87",
     300    "rgb:5f/5f/af",
     301    "rgb:5f/5f/d7",
     302    "rgb:5f/5f/ff",
     303    "rgb:5f/87/00",
     304    "rgb:5f/87/5f",
     305    "rgb:5f/87/87",
     306    "rgb:5f/87/af",
     307    "rgb:5f/87/d7",
     308    "rgb:5f/87/ff",
     309    "rgb:5f/af/00",
     310    "rgb:5f/af/5f",
     311    "rgb:5f/af/87",
     312    "rgb:5f/af/af",
     313    "rgb:5f/af/d7",
     314    "rgb:5f/af/ff",
     315    "rgb:5f/d7/00",
     316    "rgb:5f/d7/5f",
     317    "rgb:5f/d7/87",
     318    "rgb:5f/d7/af",
     319    "rgb:5f/d7/d7",
     320    "rgb:5f/d7/ff",
     321    "rgb:5f/ff/00",
     322    "rgb:5f/ff/5f",
     323    "rgb:5f/ff/87",
     324    "rgb:5f/ff/af",
     325    "rgb:5f/ff/d7",
     326    "rgb:5f/ff/ff",
     327    "rgb:87/00/00",
     328    "rgb:87/00/5f",
     329    "rgb:87/00/87",
     330    "rgb:87/00/af",
     331    "rgb:87/00/d7",
     332    "rgb:87/00/ff",
     333    "rgb:87/5f/00",
     334    "rgb:87/5f/5f",
     335    "rgb:87/5f/87",
     336    "rgb:87/5f/af",
     337    "rgb:87/5f/d7",
     338    "rgb:87/5f/ff",
     339    "rgb:87/87/00",
     340    "rgb:87/87/5f",
     341    "rgb:87/87/87",
     342    "rgb:87/87/af",
     343    "rgb:87/87/d7",
     344    "rgb:87/87/ff",
     345    "rgb:87/af/00",
     346    "rgb:87/af/5f",
     347    "rgb:87/af/87",
     348    "rgb:87/af/af",
     349    "rgb:87/af/d7",
     350    "rgb:87/af/ff",
     351    "rgb:87/d7/00",
     352    "rgb:87/d7/5f",
     353    "rgb:87/d7/87",
     354    "rgb:87/d7/af",
     355    "rgb:87/d7/d7",
     356    "rgb:87/d7/ff",
     357    "rgb:87/ff/00",
     358    "rgb:87/ff/5f",
     359    "rgb:87/ff/87",
     360    "rgb:87/ff/af",
     361    "rgb:87/ff/d7",
     362    "rgb:87/ff/ff",
     363    "rgb:af/00/00",
     364    "rgb:af/00/5f",
     365    "rgb:af/00/87",
     366    "rgb:af/00/af",
     367    "rgb:af/00/d7",
     368    "rgb:af/00/ff",
     369    "rgb:af/5f/00",
     370    "rgb:af/5f/5f",
     371    "rgb:af/5f/87",
     372    "rgb:af/5f/af",
     373    "rgb:af/5f/d7",
     374    "rgb:af/5f/ff",
     375    "rgb:af/87/00",
     376    "rgb:af/87/5f",
     377    "rgb:af/87/87",
     378    "rgb:af/87/af",
     379    "rgb:af/87/d7",
     380    "rgb:af/87/ff",
     381    "rgb:af/af/00",
     382    "rgb:af/af/5f",
     383    "rgb:af/af/87",
     384    "rgb:af/af/af",
     385    "rgb:af/af/d7",
     386    "rgb:af/af/ff",
     387    "rgb:af/d7/00",
     388    "rgb:af/d7/5f",
     389    "rgb:af/d7/87",
     390    "rgb:af/d7/af",
     391    "rgb:af/d7/d7",
     392    "rgb:af/d7/ff",
     393    "rgb:af/ff/00",
     394    "rgb:af/ff/5f",
     395    "rgb:af/ff/87",
     396    "rgb:af/ff/af",
     397    "rgb:af/ff/d7",
     398    "rgb:af/ff/ff",
     399    "rgb:d7/00/00",
     400    "rgb:d7/00/5f",
     401    "rgb:d7/00/87",
     402    "rgb:d7/00/af",
     403    "rgb:d7/00/d7",
     404    "rgb:d7/00/ff",
     405    "rgb:d7/5f/00",
     406    "rgb:d7/5f/5f",
     407    "rgb:d7/5f/87",
     408    "rgb:d7/5f/af",
     409    "rgb:d7/5f/d7",
     410    "rgb:d7/5f/ff",
     411    "rgb:d7/87/00",
     412    "rgb:d7/87/5f",
     413    "rgb:d7/87/87",
     414    "rgb:d7/87/af",
     415    "rgb:d7/87/d7",
     416    "rgb:d7/87/ff",
     417    "rgb:d7/af/00",
     418    "rgb:d7/af/5f",
     419    "rgb:d7/af/87",
     420    "rgb:d7/af/af",
     421    "rgb:d7/af/d7",
     422    "rgb:d7/af/ff",
     423    "rgb:d7/d7/00",
     424    "rgb:d7/d7/5f",
     425    "rgb:d7/d7/87",
     426    "rgb:d7/d7/af",
     427    "rgb:d7/d7/d7",
     428    "rgb:d7/d7/ff",
     429    "rgb:d7/ff/00",
     430    "rgb:d7/ff/5f",
     431    "rgb:d7/ff/87",
     432    "rgb:d7/ff/af",
     433    "rgb:d7/ff/d7",
     434    "rgb:d7/ff/ff",
     435    "rgb:ff/00/00",
     436    "rgb:ff/00/5f",
     437    "rgb:ff/00/87",
     438    "rgb:ff/00/af",
     439    "rgb:ff/00/d7",
     440    "rgb:ff/00/ff",
     441    "rgb:ff/5f/00",
     442    "rgb:ff/5f/5f",
     443    "rgb:ff/5f/87",
     444    "rgb:ff/5f/af",
     445    "rgb:ff/5f/d7",
     446    "rgb:ff/5f/ff",
     447    "rgb:ff/87/00",
     448    "rgb:ff/87/5f",
     449    "rgb:ff/87/87",
     450    "rgb:ff/87/af",
     451    "rgb:ff/87/d7",
     452    "rgb:ff/87/ff",
     453    "rgb:ff/af/00",
     454    "rgb:ff/af/5f",
     455    "rgb:ff/af/87",
     456    "rgb:ff/af/af",
     457    "rgb:ff/af/d7",
     458    "rgb:ff/af/ff",
     459    "rgb:ff/d7/00",
     460    "rgb:ff/d7/5f",
     461    "rgb:ff/d7/87",
     462    "rgb:ff/d7/af",
     463    "rgb:ff/d7/d7",
     464    "rgb:ff/d7/ff",
     465    "rgb:ff/ff/00",
     466    "rgb:ff/ff/5f",
     467    "rgb:ff/ff/87",
     468    "rgb:ff/ff/af",
     469    "rgb:ff/ff/d7",
     470    "rgb:ff/ff/ff",
     471    "rgb:08/08/08",
     472    "rgb:12/12/12",
     473    "rgb:1c/1c/1c",
     474    "rgb:26/26/26",
     475    "rgb:30/30/30",
     476    "rgb:3a/3a/3a",
     477    "rgb:44/44/44",
     478    "rgb:4e/4e/4e",
     479    "rgb:58/58/58",
     480    "rgb:62/62/62",
     481    "rgb:6c/6c/6c",
     482    "rgb:76/76/76",
     483    "rgb:80/80/80",
     484    "rgb:8a/8a/8a",
     485    "rgb:94/94/94",
     486    "rgb:9e/9e/9e",
     487    "rgb:a8/a8/a8",
     488    "rgb:b2/b2/b2",
     489    "rgb:bc/bc/bc",
     490    "rgb:c6/c6/c6",
     491    "rgb:d0/d0/d0",
     492    "rgb:da/da/da",
     493    "rgb:e4/e4/e4",
     494    "rgb:ee/ee/ee",
     495#else
     496#error XTERM_COLORS needs to be set to 88 or 256
     497#endif
    252498
    253499#ifndef NO_CURSORCOLOR
    254500    COLOR_CURSOR_BACKGROUND,
  • src/rxvt.h

    diff -ru ../y/src/rxvt.h ./src/rxvt.h
    old new  
    312312
    313313#define RS_None                 0
    314314
     315#if !defined(XTERM_COLORS) || XTERM_COLORS == 88
    315316#define RS_fgMask               0x0000007fUL    // 128 colors
    316317#define RS_bgMask               0x00003f80UL    // 128 colors
     318#elif XTERM_COLORS == 256
     319#define RS_fgMask               0x000001ffUL    // 512 colors
     320#define RS_bgMask               0x0003fe00UL    // 512 colors
     321#endif
    317322
    318323// font styles
     324#if !defined(XTERM_COLORS) || XTERM_COLORS == 88
    319325#define RS_Bold                 0x00004000UL    // value 1
    320326#define RS_Italic               0x00008000UL    // value 2
     327#elif XTERM_COLORS == 256
     328#define RS_Bold                 0x00040000UL    // value 1
     329#define RS_Italic               0x00080000UL    // value 2
     330#endif
    321331
    322332// fake styles
     333#if !defined(XTERM_COLORS) || XTERM_COLORS == 88
    323334#define RS_Blink                0x00010000UL    // blink
    324335#define RS_RVid                 0x00020000UL    // reverse video
    325336#define RS_Uline                0x00040000UL    // underline
     337#elif XTERM_COLORS == 256
     338#define RS_Blink                0x00100000UL    // blink         (disabled)
     339#define RS_RVid                 0x00200000UL    // reverse video (disabled)
     340#define RS_Uline                0x00400000UL    // underline
     341#endif
     342
    326343
    327344// toggle this to force redraw, must be != RS_Careful
    328345#define RS_redraw               0x01000000UL
    329346
     347#if !defined(XTERM_COLORS) || XTERM_COLORS == 88
    330348// 5 custom bits for extensions
    331349#define RS_customCount          32
    332350#define RS_customMask           0x00f80000UL
     351#elif XTERM_COLORS == 256
     352#define RS_customCount          0
     353#define RS_customMask           0x00000000UL
     354#endif
    333355#define RS_customShift          19
    334356
    335357// other flags
     
    337359
    338360#define RS_styleCount           4
    339361#define RS_styleMask            (RS_Bold | RS_Italic)
     362#if !defined(XTERM_COLORS) || XTERM_COLORS == 88
    340363#define RS_styleShift           14
     364#elif XTERM_COLORS == 256
     365#define RS_styleShift           18
     366#endif
    341367
    342368#define RS_baseattrMask         (RS_Italic | RS_Bold | RS_Blink | RS_RVid | RS_Uline)
    343369#define RS_attrMask             (RS_baseattrMask | RS_fontMask)
     
    463489  Color_White = maxCOLOR,
    464490#endif
    465491  minTermCOLOR = Color_White + 1,
     492#if !defined(XTERM_COLORS) || XTERM_COLORS == 88
    466493  maxTermCOLOR = Color_White + 72,
     494#elif (XTERM_COLORS == 256)
     495  maxTermCOLOR = Color_White + 240,
     496#else
     497#error XTERM_COLORS needs to be set to 88 or 256
     498#endif
    467499#ifndef NO_CURSORCOLOR
    468500  Color_cursor,
    469501  Color_cursor2,
     
    503535#endif
    504536};
    505537
     538#if !defined(XTERM_COLORS) || XTERM_COLORS == 88
    506539#define Color_Bits      7 // 0 .. maxTermCOLOR
     540#elif XTERM_COLORS == 256
     541#define Color_Bits      9 // 0 .. maxTermCOLOR
     542#endif
    507543
    508544/*
    509545 * Resource list