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
(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
=item B<cutchars:> I<string>
-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
XNFontSet, fs,
NULL);
}
+#if ENABLE_XIM_ONTHESPOT
else if (input_style & XIMPreeditCallbacks)
{
im_set_position (spot);
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,
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;
#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))
#include <wchar.h>
#include <inttypes.h>
-#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;
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;
}
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;
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;
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;
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;
while (*s)
{
text_t t = *s++;
- int width = wcwidth (t);
+ int width = WCWIDTH (t);
while (width--)
{