*** empty log message ***
authorroot <root>
Fri, 6 Jan 2006 21:06:09 +0000 (21:06 +0000)
committerroot <root>
Fri, 6 Jan 2006 21:06:09 +0000 (21:06 +0000)
MANIFEST
src/perl/block-graphics-to-ascii [new file with mode: 0644]
src/perl/example-filter-input [deleted file]
src/rxvtperl.xs
src/urxvt.pm

index 0d367e931d75e7f20bb640a1ac7584ac3360eac0..f3eb8b49b135d7ac0a1ce6238c1e5aa42b4d6ff3 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -171,7 +171,7 @@ src/rxvtperl.h
 src/rxvtperl.xs
 
 src/perl/example-refresh-hooks
-src/perl/example-filter-input
+src/perl/block-graphics-to-ascii
 src/perl/digital-clock
 src/perl/selection
 src/perl/mark-urls
diff --git a/src/perl/block-graphics-to-ascii b/src/perl/block-graphics-to-ascii
new file mode 100644 (file)
index 0000000..4bdb1b3
--- /dev/null
@@ -0,0 +1,16 @@
+#! perl
+
+#          ─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏
+my $rep = "--||--||--||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--||"
+#          ═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲ ╳╴╵╶╷╸╹╺╻╼╽╾╿▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟
+        . "=|+++++++++++++++++++++++++++++++/\\X-|-|-|-|-|-|#____#######|||||###~###########";
+
+sub on_add_lines {
+   my ($term, $str) = @_;
+
+   $str =~ s/([\x{2500}-\x{259f}])/substr $rep, (ord $1) - 0x2500, 1/ge;
+   $term->scr_add_lines ($str);
+
+   1
+}
+
diff --git a/src/perl/example-filter-input b/src/perl/example-filter-input
deleted file mode 100644 (file)
index ce19f2b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#! perl
-
-# same url as used in "selection"
-my $url =
-   qr{(
-      (?:https?|ftp|news|mailto|file)://[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~]+
-      [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27(),~]   # do not include a trailing dot, its wrong too often
-   )}x;
-
-sub on_add_lines {
-   my ($term, $str) = @_;
-
-   while ($str =~ $url) {
-      # found a url, first output preceding text
-      $term->scr_add_lines (substr $str, 0, $-[1], "");
-      # then toggle underline
-      $term->rstyle ($term->rstyle ^ urxvt::RS_Uline);
-      # now output the url
-      $term->scr_add_lines (substr $str, 0, $+[1] - $-[1], "");
-      # toggle undelrine again
-      $term->rstyle ($term->rstyle ^ urxvt::RS_Uline);
-   }
-
-   # output trailing text
-   $term->scr_add_lines ($str);
-
-   1
-}
-
index ffed0dd279b81cd2c8847d846f2c748e834e9a63..ea90adbe8a3f393ff29c241e70b3042aae10d1fc 100644 (file)
@@ -487,6 +487,7 @@ rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...)
 
             XPUSHs (sv_2mortal (wcs2sv (wstr, wlen)));
           }
+         break;
 
         case DT_XEVENT:
           {
index d067439c5e2b20b07ea430834e42a819e8813d66..7f8cbfad0e0a85fc4f9f234bdd26d5776997ffd5 100644 (file)
@@ -64,7 +64,13 @@ Displays a digital clock using the built-in overlay.
 
 =item mark-urls
 
-Uses per-line filtering (C<on_line_update>) to underline urls.
+Uses per-line display filtering (C<on_line_update>) to underline urls.
+
+=item block-graphics-to-ascii
+
+A not very useful example of filtering all text output to the terminal,
+by replacing all line-drawing characters (U+2500 .. U+259F) by a
+similar-looking ascii character.
 
 =item example-refresh-hooks
 
@@ -72,13 +78,6 @@ Displays a very simple digital clock in the upper right corner of the
 window. Illustrates overwriting the refresh callbacks to create your own
 overlays or changes.
 
-=item example-filter-input
-
-A not very useful example of filtering all text output to the terminal, by
-underlining all urls that matches a certain regex (i.e. some urls :). It
-is not very useful because urls that are output in multiple steps (e.g.
-when typing them) do not get marked.
-
 =back
 
 =head2 General API Considerations