*** empty log message ***
authorroot <root>
Wed, 25 Jan 2006 13:24:45 +0000 (13:24 +0000)
committerroot <root>
Wed, 25 Jan 2006 13:24:45 +0000 (13:24 +0000)
Changes
doc/rxvt.1.pod
src/main.C
src/perl/selection
src/rxvt.h
src/rxvtfont.C
src/screen.C

diff --git a/Changes b/Changes
index 51c5856770ba7325334cf48834570cf1e9d560f7..735eb2e25f4e091ca9b2f4712e63e75ba5c68172 100644 (file)
--- 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
index 05a575ffc07972376256e4e011b072a25e59e2a1..3c89d5f045f4e0ab3652b67e04594729c42b17f3 100644 (file)
@@ -898,7 +898,8 @@ with the B<Execute> key.
 
 =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
index 2ecb97edb1267b96d84e2f269f35ff893220172c..f302c54531efb9ecc8afccecd98942a8190a75e5 100644 (file)
@@ -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,
index 14a53091419879b7108b76a5764485b5e8b6400e..be16135fc0a72d1aa7ba8744e28bcf93affe8ff7 100644 (file)
@@ -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;
index 610e4bc6890eb4a05f4b1a90b38bf8c4f6854c3c..eb8b952674ce7aa724c954afd34288a85e6cb2cd 100644 (file)
@@ -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))
index 65d71fe74c953c76446c019b6482658fc01a9e31..6d2f12dfd88eace5a1beb33563c275354bd50ca5 100644 (file)
 #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;
@@ -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;
index 198544668369dfea5e998f798cd46cb1f12fd647..2e9e0d792ec0b650bd6d9f620c690f7c4e4c6905 100644 (file)
@@ -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--)
         {