From: root Date: Wed, 25 Jan 2006 13:24:45 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=77d26c7fd7df92081d73fa12abc05e15b3dc9254;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 51c58567..735eb2e2 100644 --- a/Changes +++ b/Changes @@ -2,17 +2,17 @@ rxvt-unicode changelog <= google-friendly title TODO: event mechanism that replaces on_keyboard_command with something more scalable. TODO: simplify selection_request and make it callable from perl. -TODO: split perl documnetation and urxvt.pm into separate files +TODO: split perl documentation and urxvt.pm into separate files TODO: harmonize --disable-options into position-dependent options. TODO: after requesting the selection and getting a timeout, no further requests will be sent. TODO: "slow" rendering mode for bidi and scripts TODO: read property sequence is broken with respect to utf-8 etc. -TODO: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look. TODO: rxvt -name urxvt-girly /// leave pixel droppings TODO: distributed clipboard example WISH: anyevent mouse notification / manage MotionMask better. WISH: OnTheSpot editing, or maybe switch to miiiiiiif. or maybe use perl and an overlay... WISH: just for fun, do shade and tint with XRender. +WISH: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look. DUMB: support tex fonts TODO: move resources out of allocated @@ -20,7 +20,14 @@ TODO: move resources out of allocated (could lead to global grabs never being cleared). - experimental OnTheSpot editing support (-pe xim-onthespot). - moved Shift-Button2 paste combination to Meta-Button2. + - the cutchars resource will now be respected and used by the + selection extension. - removed (unused) arabic presentation form composing sequences. + - be more strict when deciding that a core font glyph is too wide and + needs the careful rendering mode. + - allow more leeway for italic fonts when deciding that a character is + too wide and needs careful mode. + - redraw even more characters around characters usign careful mode. - reduced number of server turnarounds at startup by allocating atoms only once per display. - changed version sos (ESC [ > c) response to be more compatible with diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index 05a575ff..3c89d5f0 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -898,7 +898,8 @@ with the B key. =item B I -The characters used as delimiters for double-click word selection. +The characters used as delimiters for double-click word selection +(whitespace delimiting is added automatically if resource is given). When the selection extension is in use (the default if compiled in, see the @@RXVT_NAME@@perl(3) manpage), a suitable regex using these characters diff --git a/src/main.C b/src/main.C index 2ecb97ed..f302c545 100644 --- a/src/main.C +++ b/src/main.C @@ -1488,6 +1488,7 @@ foundpet: XNFontSet, fs, NULL); } +#if ENABLE_XIM_ONTHESPOT else if (input_style & XIMPreeditCallbacks) { im_set_position (spot); @@ -1495,20 +1496,21 @@ foundpet: xcb[0].client_data = (XPointer)this; xcb[0].callback = (XIMProc)xim_preedit_start; xcb[1].client_data = (XPointer)this; xcb[1].callback = (XIMProc)xim_preedit_done; xcb[2].client_data = (XPointer)this; xcb[2].callback = (XIMProc)xim_preedit_draw; -#if 0 +# if 0 xcb[3].client_data = (XPointer)this; xcb[3].callback = (XIMProc)xim_preedit_caret; -#endif +# endif preedit_attr = XVaCreateNestedList (0, XNSpotLocation, &spot, XNPreeditStartCallback, &xcb[0], XNPreeditDoneCallback , &xcb[1], XNPreeditDrawCallback , &xcb[2], -#if 0 +# if 0 XNPreeditCaretCallback, &xcb[3], -#endif +# endif NULL); } +#endif Input_Context = XCreateIC (xim, XNInputStyle, input_style, diff --git a/src/perl/selection b/src/perl/selection index 14a53091..be16135f 100644 --- a/src/perl/selection +++ b/src/perl/selection @@ -12,6 +12,11 @@ sub on_keyboard_command { sub on_init { my ($self) = @_; + if (defined (my $res = $self->resource ("cutchars"))) { + $res = $self->locale_decode ($res); + push @{ $self->{patterns} }, qr{\G [\Q$res\E[:space:]]* ([^\Q$res\E[:space:]]+) }x; + } + for (my $idx = 0; defined (my $res = $self->x_resource ("selection.pattern-$idx")); $idx++) { $res = $self->locale_decode ($res); utf8::encode $res; diff --git a/src/rxvt.h b/src/rxvt.h index 610e4bc6..eb8b9526 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -704,9 +704,9 @@ enum { #define dDisp Display *disp = this->display->display // for speed reasons, we assume that all latin1 characters -// are single-width (the first unicdoe combining character +// are single-width (the first unicode combining character // is actually 0x300, but ascii is what matters most). -#define WCWIDTH(c) ((c) < 0x100 ? 1 : wcwidth (c)) +#define WCWIDTH(c) ((c) & ~0xff ? wcwidth (c) : 1) /* convert pixel dimensions to row/column values. Everything as int32_t */ #define Pixel2Col(x) Pixel2Width((int32_t)(x)) diff --git a/src/rxvtfont.C b/src/rxvtfont.C index 65d71fe7..6d2f12df 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -29,7 +29,14 @@ #include #include -#define MAX_OVERLAP (4 + 1) // max. character width in 4ths of the base width +#define MAX_OVERLAP_ROMAN (8 + 2) // max. character width in 8ths of the base width +#define MAX_OVERLAP_ITALIC (8 + 3) // max. overlap for italic fonts + +#define OVERLAP_OK(w,prop) (w) > ( \ + prop->slant >= rxvt_fontprop::italic \ + ? (prop->width * MAX_OVERLAP_ITALIC + 7) >> 3 \ + : (prop->width * MAX_OVERLAP_ROMAN + 7) >> 3 \ + ) const struct rxvt_fallback_font { codeset cs; @@ -850,7 +857,7 @@ rxvt_font_x11::load (const rxvt_fontprop &prop) int dir_ret, asc_ret, des_ret; XTextExtents16 (f, &ch, 1, &dir_ret, &asc_ret, &des_ret, &g); - int wcw = wcwidth (*t); if (wcw > 0) g.width = (g.width + wcw - 1) / wcw; + int wcw = WCWIDTH (*t); if (wcw > 0) g.width = (g.width + wcw - 1) / wcw; if (width < g.width) width = g.width; } @@ -933,12 +940,12 @@ rxvt_font_x11::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &car return true; // check character against base font bounding box - int w = xcs->width; - int wcw = wcwidth (unicode); + int w = xcs->rbearing - xcs->lbearing; + int wcw = WCWIDTH (unicode); if (wcw > 0) w = (w + wcw - 1) / wcw; careful = w > prop->width; - if (careful && w > prop->width * MAX_OVERLAP >> 2) + if (careful && OVERLAP_OK (w, prop)) return false; return true; @@ -1178,7 +1185,7 @@ rxvt_font_xft::load (const rxvt_fontprop &prop) g.width -= g.x; - int wcw = wcwidth (ch); + int wcw = WCWIDTH (ch); if (wcw > 0) g.width = (g.width + wcw - 1) / wcw; if (width < g.width ) width = g.width; @@ -1250,11 +1257,11 @@ rxvt_font_xft::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &car XftTextExtents32 (term->display->display, f, &ch, 1, &g); int w = g.width - g.x; - int wcw = wcwidth (unicode); + int wcw = WCWIDTH (unicode); if (wcw > 0) w = (w + wcw - 1) / wcw; careful = w > prop->width; - if (careful && w > prop->width * MAX_OVERLAP >> 2) + if (careful && OVERLAP_OK (w, prop)) return false; return true; diff --git a/src/screen.C b/src/screen.C index 19854466..2e9e0d79 100644 --- a/src/screen.C +++ b/src/screen.C @@ -2246,15 +2246,21 @@ rxvt_term::scr_refresh () NOTHROW if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) { #if ENABLE_STYLES - // force redraw after "careful" characters to avoid pixel droppings - if (srp[col] & RS_Careful && col < ncol - 1 && 0) - drp[col + 1] = ~srp[col + 1]; + // "careful" (too wide) character handling // include previous careful character(s) if possible, looks nicer (best effort...) while (text > stp && srp[text - stp - 1] & RS_Careful && RS_SAME (rend, srp[text - stp - 1])) text--, count++, xpixel -= fwidth; + + // force redraw after "careful" characters to avoid pixel droppings + for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) + drp[col + i + 1] = ~srp[col + i + 1]; + + // force redraw before "careful" characters to avoid pixel droppings + for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++) + drp[text - stp - i - 1] = ~srp[text - stp - i - 1]; #endif bool invert = rend & RS_RVid; @@ -3766,7 +3772,7 @@ rxvt_term::scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW while (*s) { text_t t = *s++; - int width = wcwidth (t); + int width = WCWIDTH (t); while (width--) {