-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 5caed81a4632d7b7f964ffb6285061118b49c853: path_to: revision_to:
commit 5caed81a4632d7b7f964ffb6285061118b49c853 Author: Marc Lehmann <schmorp@schmorp.de> Date: Mon Jan 19 17:26:43 2004 +0000 *** empty log message *** diff --git a/Changes b/Changes
--- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ 1.5 - share io manager between rxvt-unicode and vpe + - bugfix for --disable-utmp, reported by fefe himsel. + - colors were sometimes not used correctly because + parts of the code expected a monochrome display. + reported by fefe. + - make it compile without pointer_blank, reported by + Markus Demleitner. 1.4 Fri Jan 16 23:03:22 CET 2004 - fix stupid segfault on esc-c diff --git a/src/command.C b/src/command.C
--- a/src/command.C +++ b/src/command.C @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: command.c *----------------------------------------------------------------------* - * $Id: command.C,v 1.28 2004/01/16 22:11:09 pcg Exp $ + * $Id: command.C,v 1.29 2004/01/19 17:26:43 pcg Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> @@ -1022,21 +1022,19 @@ rxvt_cmd_getc(pR) #endif } +#ifdef POINTER_BLANK void rxvt_term::pointer_unblank () { XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor); recolour_cursor (); -#ifdef POINTER_BLANK hidden_pointer = 0; if (Options & Opt_pointerBlank) pointer_ev.start (NOW + pointerBlankDelay); -#endif } -#ifdef POINTER_BLANK void rxvt_term::pointer_blank () { diff --git a/src/feature.h b/src/feature.h
--- a/src/feature.h +++ b/src/feature.h @@ -65,14 +65,6 @@ */ /* #define NO_BOLD_UNDERLINE_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 - */ -/* #define NO_BOLDOVERSTRIKE */ -/* #define NO_BOLDOVERSTRIKE_MULTI */ - /* * Don't bother cleaning up pixel droppings. If you don't use bold * overstrike then you don't usually need this diff --git a/src/init.C b/src/init.C
--- a/src/init.C +++ b/src/init.C @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: init.c *----------------------------------------------------------------------* - * $Id: init.C,v 1.16 2003/12/18 13:33:02 pcg Exp $ + * $Id: init.C,v 1.17 2004/01/19 17:26:43 pcg Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> @@ -1044,12 +1044,11 @@ rxvt_term::color_aliases(int idx) { /* bright colors */ i -= 8; #ifndef NO_BRIGHTCOLOR - rs[Rs_color + idx] = rs[Rs_color + minBrightCOLOR + i]; return; #endif - } + if (i >= 0 && i <= 7) /* normal colors */ rs[Rs_color + idx] = rs[Rs_color + minCOLOR + i]; } @@ -1137,40 +1136,40 @@ rxvt_term::create_windows (int argc, const char *const *argv) XGCValues gcvalue; long vt_emask; -#ifdef PREFER_24BIT XSetWindowAttributes attributes; XWindowAttributes gattr; - XCMAP = DefaultColormap(Xdisplay, Xscreen); - XVISUAL = DefaultVisual(Xdisplay, Xscreen); + Xcmap = DefaultColormap (Xdisplay, Xscreen); + Xvisual = DefaultVisual (Xdisplay, Xscreen); + Xscreen = DefaultScreen (Xdisplay); if (Options & Opt_transparent) { - XGetWindowAttributes(Xdisplay, RootWindow(Xdisplay, Xscreen), - &gattr); - XDEPTH = gattr.depth; + XGetWindowAttributes (Xdisplay, RootWindow(Xdisplay, Xscreen), &gattr); + Xdepth = gattr.depth; } else { - XDEPTH = DefaultDepth(Xdisplay, Xscreen); + Xdepth = DefaultDepth(Xdisplay, Xscreen); +#ifdef PREFER_24BIT /* * If depth is not 24, look for a 24bit visual. */ - if (XDEPTH != 24) + if (Xdepth != 24) { XVisualInfo vinfo; if (XMatchVisualInfo(Xdisplay, Xscreen, 24, TrueColor, &vinfo)) { - XDEPTH = 24; - XVISUAL = vinfo.visual; - XCMAP = XCreateColormap(Xdisplay, + Xdepth = 24; + Xvisual = vinfo.visual; + Xcmap = XCreateColormap(Xdisplay, RootWindow(Xdisplay, Xscreen), - XVISUAL, AllocNone); + Xvisual, AllocNone); } } - } #endif + } /* grab colors before netscape does */ rxvt_Get_Colours (this); @@ -1259,22 +1258,21 @@ rxvt_term::create_windows (int argc, const char *const *argv) PixColors[Color_fg], PixColors[Color_bg]); #ifdef DEBUG_X - XStoreName(Xdisplay, TermWin.vt, "vt window"); #endif - pointer_unblank (); - vt_emask = (ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask); + #ifdef POINTER_BLANK + pointer_unblank (); if ((Options & Opt_pointerBlank)) vt_emask |= PointerMotionMask; else #endif - vt_emask |= (Button1MotionMask | Button3MotionMask); + XSelectInput(Xdisplay, TermWin.vt, vt_emask); #if defined(MENUBAR) && (MENUBAR_MAX > 1) @@ -1428,7 +1426,10 @@ rxvt_term::run_command (const char *const *argv) dup2 (tty_fd, STDIN_FILENO); #endif +#ifdef UTMP_SUPPORT rxvt_privileged_utmp (this, SAVE); +#endif + #if defined(HAVE_STRUCT_UTMP) && defined(HAVE_TTYSLOT) dup2 (fdstdin, STDIN_FILENO); diff --git a/src/iom.C b/src/iom.C
--- a/src/iom.C +++ b/src/iom.C @@ -21,9 +21,17 @@ #include <cstdlib> #include <cerrno> -#include <sys/select.h> #include <sys/time.h> +#if 1 // older unices need these includes for select(2) +# include <unistd.h> +# include <sys/types.h> +#endif + +// if the BSDs would at least be marginally POSIX-compatible.. *sigh* +// until that happens, sys/select.h must come last +#include <sys/select.h> + #include "iom.h" // TSTAMP_MAX must still fit into a positive struct timeval @@ -250,7 +258,6 @@ io_manager::io_manager () set_now (); tw0.start (TSTAMP_MAX); - printf ("abort, %f but inly on %f\n", NOW, tw0.at); #endif } diff --git a/src/rxvt.h b/src/rxvt.h
--- a/src/rxvt.h +++ b/src/rxvt.h @@ -316,13 +316,7 @@ enum { SECONDARY }; -enum { - SBYTE = 0, - WBYTE -}; - - -#define RS_None 0 /* Normal */ +#define RS_None 0 /* Normal */ #define RS_fgMask 0x000001FFu /* 512 colors */ #define RS_bgMask 0x0003FE00u /* 512 colors */ @@ -331,14 +325,11 @@ enum { #define RS_RVid 0x00100000u /* reverse video */ #define RS_Uline 0x00200000u /* underline */ -#define RS_wide 0x00400000u /* only multibyte characters */ -#define IS_WIDE(r) ((r) & RS_wide) - -#define RS_fontMask 0xff000000u /* plenty(?) of fonts */ -#define RS_fontShift 24 +#define RS_fontMask 0xffc00000u /* plenty(?) of fonts */ +#define RS_fontShift 22 #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) -#define RS_attrMask (RS_baseattrMask|RS_fontMask|RS_wide) +#define RS_attrMask (RS_baseattrMask|RS_fontMask) #define Sel_none 0 /* Not waiting */ #define Sel_normal 0x01 /* normal selection */ @@ -453,10 +444,10 @@ enum colour_list { }; #define Color_Bits 9 -#define NPIXCLR_SETS 9 /* (256 + 14) bits / 32 bits */ +#define NPIXCLR_SETS ((TOTAL_COLORS + 31) / 32) #define NPIXCLR_BITS 32 -#define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) +#define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) /* * Resource list @@ -619,24 +610,15 @@ enum { (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) #endif -#ifdef PREFER_24BIT -# define XDEPTH R->Xdepth -# define XCMAP R->Xcmap -# define XVISUAL R->Xvisual -#else -# ifdef DEBUG_DEPTH -# define XDEPTH DEBUG_DEPTH -# else -# define XDEPTH DefaultDepth(R->Xdisplay,Xscreen) -# define XCMAP DefaultColormap(R->Xdisplay,Xscreen) -# define XVISUAL DefaultVisual(R->Xdisplay,Xscreen) -# endif -#endif -#define IMBUFSIZ 128 /* input modifier buffer sizes */ +#define XDEPTH R->Xdepth +#define XCMAP R->Xcmap +#define XVISUAL R->Xvisual + +#define IMBUFSIZ 128 /* input modifier buffer sizes */ #ifndef BUFSIZ -# define BUFSIZ 4096 +# define BUFSIZ 4096 #endif -#define KBUFSZ 512 /* size of keyboard mapping buffer */ +#define KBUFSZ 512 /* size of keyboard mapping buffer */ /* ***************************************************************************** @@ -672,7 +654,6 @@ enum { #define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth) #define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth) -#define Xscreen DefaultScreen(R->Xdisplay) #define Xroot DefaultRootWindow(R->Xdisplay) /* how to build & extract colors and attributes */ @@ -709,7 +690,7 @@ enum { #define SET_ATTR(x,a) (((x) & ~RS_attrMask)| (a)) #define SET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) -#define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) +#define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) #ifdef HAVE_SCROLLBARS # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) @@ -945,10 +926,6 @@ struct rxvt_term : rxvt_vars { ttymode; unsigned long PrivateModes, SavedModes; -/* ---------- */ -#ifdef PREFER_24BIT - Visual *Xvisual; -#endif /* ---------- */ Atom xa[NUM_XA]; /* ---------- */ diff --git a/src/rxvtcolor.C b/src/rxvtcolor.C
--- a/src/rxvtcolor.C +++ b/src/rxvtcolor.C @@ -10,7 +10,7 @@ rxvt_color::set (pR_ Pixel p) XColor xc; xc.pixel = p; - if (!XQueryColor (R->Xdisplay, XCMAP, &xc)) + if (!XQueryColor (R->Xdisplay, R->Xcmap, &xc)) return false; XRenderColor d; @@ -22,8 +22,8 @@ rxvt_color::set (pR_ Pixel p) return XftColorAllocValue (R->Xdisplay, - XVISUAL, - XCMAP, + R->Xvisual, + R->Xcmap, &d, &c); #else @@ -38,7 +38,7 @@ rxvt_color::set (pR_ const char *name) { XColor xc; - if (XParseColor (R->Xdisplay, XCMAP, name, &xc)) + if (XParseColor (R->Xdisplay, R->Xcmap, name, &xc)) return set (aR_ xc.red, xc.green, xc.blue); return false; @@ -54,7 +54,7 @@ rxvt_color::set (pR_ unsigned short cr, unsigned short cg, unsigned short cb) xc.blue = cb; xc.flags = DoRed | DoGreen | DoBlue; - if (XAllocColor (R->Xdisplay, XCMAP, &xc)) + if (XAllocColor (R->Xdisplay, R->Xcmap, &xc)) return set (aR_ xc.pixel); return false; @@ -71,7 +71,7 @@ rxvt_color::get (pR_ unsigned short &cr, unsigned short &cg, unsigned short &cb) XColor c; c.pixel = p; - XQueryColor (R->Xdisplay, XCMAP, &c); + XQueryColor (R->Xdisplay, R->Xcmap, &c); cr = c.red; cg = c.green; diff --git a/src/rxvtlib.h.in b/src/rxvtlib.h.in
--- a/src/rxvtlib.h.in +++ b/src/rxvtlib.h.in @@ -1,5 +1,5 @@ /* - * $Id: rxvtlib.h.in,v 1.7 2003/12/18 05:45:11 pcg Exp $ + * $Id: rxvtlib.h.in,v 1.8 2004/01/19 17:26:43 pcg Exp $ */ #ifndef _RXVTLIB_H_ /* include once only */ @@ -292,14 +292,16 @@ struct rxvt_vars { TermWin_t TermWin; scrollBar_t scrollBar; menuBar_t menuBar; - Display *Xdisplay; unsigned long Options; XSizeHints szHint; + Display *Xdisplay; + int Xdepth; + int Xscreen; + Visual *Xvisual; Colormap Xcmap; rxvt_color *PixColors; short numPixColors; Cursor TermWin_cursor; /* cursor for vt window */ - int Xdepth; int sb_shadow; /* scrollbar shadow width */ int Xfd; /* file descriptor of X server connection */ int cmd_fd; /* pty file descriptor; connected to command */ diff --git a/src/screen.C b/src/screen.C
--- a/src/screen.C +++ b/src/screen.C @@ -1,7 +1,6 @@ /*--------------------------------*-C-*--------------------------------------* * File: screen.c *---------------------------------------------------------------------------* - * $Id: screen.C,v 1.16 2004/01/16 22:11:09 pcg Exp $ * * Copyright (c) 1997-2001 Geoff Wing <gcw@pobox.com> * @@ -904,27 +903,32 @@ rxvt_scr_add_lines(pR_ const uint32_t *str, int nlines, int len) // rely on wcwidth to tell us the character width, at least for non-ascii int width = c <= 128 ? 1 : wcwidth (c); - // width 0 characters (e.g. combining chars) are ignored. your problem, really - while (width-- > 0) - { - stp[R->screen.cur.col] = c; - srp[R->screen.cur.col] = rend; + // width -1 characters (e.g. combining chars) are ignored currently. + if (width > 0) + do + { + stp[R->screen.cur.col] = c; + srp[R->screen.cur.col] = rend; - if (R->screen.cur.col < last_col - 1) - R->screen.cur.col++; - else - { - R->screen.tlen[row] = last_col; - if (R->screen.flags & Screen_Autowrap) - R->screen.flags |= Screen_WrapNext; - break; - } + if (R->screen.cur.col < last_col - 1) + R->screen.cur.col++; + else + { + R->screen.tlen[row] = last_col; + if (R->screen.flags & Screen_Autowrap) + R->screen.flags |= Screen_WrapNext; + break; + } - c = NOCHAR; - } + c = NOCHAR; + } + while (--width > 0); + else + 1; /* handle combining character etc. here. */ } + if (R->screen.tlen[row] != -1) /* XXX: think about this */ - MAX_IT(R->screen.tlen[row], R->screen.cur.col); + MAX_IT(R->screen.tlen[row], R->screen.cur.col); /* * If we wrote anywhere in the selected area, kill the selection @@ -1641,27 +1645,6 @@ rxvt_scr_charset_set(pR_ int set, unsigned int ch) rxvt_set_font_style(aR); } - -/* ------------------------------------------------------------------------- * - * GRAPHICS COLOURS * - * ------------------------------------------------------------------------- */ - -#ifdef RXVT_GRAPHICS -/* EXTPROTO */ -int -rxvt_scr_get_fgcolor(pR) -{ - return GET_FGCOLOR(R->rstyle); -} - -/* ------------------------------------------------------------------------- */ -/* EXTPROTO */ -int -rxvt_scr_get_bgcolor(pR) -{ - return GET_BGCOLOR(R->rstyle); -} -#endif /* ------------------------------------------------------------------------- * * MAJOR SCREEN MANIPULATION * @@ -1852,15 +1835,6 @@ rxvt_scr_printscreen(pR_ int fullhist) * R->screen.text/R->screen.rend contain what the screen will change to. */ -#if defined (NO_BRIGHTCOLOR) || defined (VERYBOLD) -# define MONO_BOLD(x) ((x) & (RS_Bold|RS_Blink)) -# define MONO_BOLD_FG(x, fg) MONO_BOLD(x) -#else -# define MONO_BOLD(x) \ - (((x) & (RS_Bold | RS_fgMask)) == (RS_Bold | Color_fg)) -# define MONO_BOLD_FG(x, fg) (((x) & RS_Bold) && (fg) == Color_fg) -#endif - #define FONT_WIDTH(X, Y) \ (X)->per_char[(Y) - (X)->min_char_or_byte2].width #define FONT_RBEAR(X, Y) \ @@ -1876,13 +1850,8 @@ rxvt_term::scr_refresh (unsigned char refresh_type) unsigned char clearfirst, /* first character writes before cell */ clearlast, /* last character writes beyond cell */ must_clear, /* use draw_string not draw_image_string */ -#ifndef NO_BOLDFONT - bfont, /* we've changed font to bold font */ -#endif rvid, /* reverse video this position */ - wbyte, /* we're in multibyte */ showcursor; /* show the cursor */ - int fore, back; /* desired foreground/background */ int16_t col, row, /* column/row we're processing */ ocrow; /* old cursor row */ int cursorwidth; @@ -1901,10 +1870,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type) /* * A: set up vars */ - clearfirst = clearlast = must_clear = wbyte = 0; -#ifndef NO_BOLDFONT - bfont = 0; -#endif + clearfirst = clearlast = must_clear = 0; if (currmaxcol < TermWin.ncol) { @@ -1985,9 +1951,6 @@ rxvt_term::scr_refresh (unsigned char refresh_type) *srp = SET_BGCOLOR(*srp, ccol2); #endif } - - while (IS_WIDE (*srp)) - cursorwidth++, srp++; } /* make sure no outline cursor is left around */ @@ -2140,7 +2103,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type) continue; } - if (((rend ^ srp[col]) & ~RS_wide) != 0) + if (rend != srp[col]) break; count++; @@ -2165,12 +2128,13 @@ rxvt_term::scr_refresh (unsigned char refresh_type) /* * Determine the attributes for the string */ - int fid = GET_FONT(rend); - fore = GET_FGCOLOR(rend); - back = GET_BGCOLOR(rend); - rend = GET_ATTR(rend); + int fid = GET_FONT (rend); + int fore = GET_FGCOLOR (rend); // desired foreground + int back = GET_BGCOLOR (rend); // desired background + + rend = GET_ATTR (rend); - rvid = (rend & RS_RVid) ? 1 : 0; + rvid = !!(rend & RS_RVid); #ifdef OPTION_HC if (!rvid && (rend & RS_Blink)) { @@ -2197,20 +2161,12 @@ rxvt_term::scr_refresh (unsigned char refresh_type) else if (rend & RS_Bold) { if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_BD)) - { - fore = Color_BD; -# ifndef VERYBOLD - rend &= ~RS_Bold; /* we've taken care of it */ -# endif - } + fore = Color_BD; } else if (rend & RS_Uline) { if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_UL)) - { - fore = Color_UL; - rend &= ~RS_Uline; /* we've taken care of it */ - } + fore = Color_UL; } #endif
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 12:26:15 2024