*** empty log message ***
authorroot <root>
Tue, 3 Jan 2006 04:45:03 +0000 (04:45 +0000)
committerroot <root>
Tue, 3 Jan 2006 04:45:03 +0000 (04:45 +0000)
src/rxvtperl.xs

index e801dc14b8125146899ceb2d3b531f6b193ed81d..245068d28e192e0565ab1e2f08705dc69a901cbb 100644 (file)
@@ -284,7 +284,7 @@ void overlay::swap ()
 
 }
 
-void overlay::set (int x, int y, SV *str, SV *rend)
+void overlay::set (int x, int y, SV *text, SV *rend)
 {
   x += border;
   y += border;
@@ -292,12 +292,23 @@ void overlay::set (int x, int y, SV *str, SV *rend)
   if (!IN_RANGE_EXC (y, 0, h - border))
     return;
 
-  wchar_t *wstr = sv2wcs (str);
+  wchar_t *wtext = sv2wcs (text);
 
-  for (int col = min (wcslen (wstr), w - x - border); col--; )
-    text [y][x + col] = wstr [col];
+  for (int col = min (wcslen (wtext), w - x - border); col--; )
+    this->text [y][x + col] = wtext [col];
   
-  free (wstr);
+  free (wtext);
+
+  if (rend)
+    {
+      if (!SvROK (rend) || SvTYPE (SvRV (rend)) != SVt_PVAV)
+        croak ("rend must be arrayref");
+
+      AV *av = (AV *)SvRV (rend);
+
+      for (int col = min (av_len (av) + 1, w - x - border); col--; )
+        this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1));
+    }
 
   THIS->want_refresh = 1;
 }