chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / ansi.c
index 019422821bf5e5fe49c9c8128b2b2a0cfe680651..66c70f1125580fc90daea059e877cec5d4011137 100644 (file)
@@ -10,6 +10,18 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.28  2008/02/22 17:07:00  james
+ * *** empty log message ***
+ *
+ * Revision 1.27  2008/02/20 22:54:22  staffcvs
+ * *** empty log message ***
+ *
+ * Revision 1.26  2008/02/20 20:16:07  james
+ * *** empty log message ***
+ *
+ * Revision 1.25  2008/02/20 19:44:37  james
+ * @@
+ *
  * Revision 1.24  2008/02/20 19:36:06  james
  * @@
  *
@@ -519,6 +531,9 @@ ansi_history (ANSI * a, History * h)
       /*Roll HISTORY_GUESS_SCROLL lines up putting the top line into the xterm's history */
 
 
+      /*Make extra lines a predictable colour*/
+      ansi_set_color (a, CRT_COLOR_NORMAL);
+
       ansi_showhide_cursor (a, 1);
       i = sprintf (buf, "\033[%d;%dH", HISTORY_GUESS_SCROLL, 1);
       a->terminal->xmit (a->terminal, buf, i);
@@ -544,7 +559,7 @@ ansi_history (ANSI * a, History * h)
         /* erase new line */
         s.y = e.y;
         e.x = CRT_COLS - 1;
-        crt_erase (&a->crt, s, e, 1);
+        crt_erase (&a->crt, s, e, 1,CRT_COLOR_NORMAL);
       }
 
     }
@@ -817,7 +832,7 @@ ansi_dispatch (ANSI * a, Context * c)
 
 
   if (!a->terminal)
-    return;
+    return 0;
 
   red = a->terminal->recv (a->terminal, buf, sizeof (buf));
   if (red <= 0)
@@ -853,28 +868,32 @@ ansi_update (ANSI * a, Context * c)
   ansi_draw (a, &c->v->crt);
 }
 
-static void ansi_free(ANSI *a)
+static void
+ansi_free (ANSI * a)
 {
-      a->terminal_reset(a);
-      if (a->terminal) 
-       a->terminal->close(a->terminal);
+  a->terminal_reset (a);
+  if (a->terminal)
+    a->terminal->close (a->terminal);
 
-       free(a);
+  free (a);
 
 }
 
-ANSI *ansi_new_from_terminal(ANSI *a,TTY *t)
+ANSI *
+ansi_new_from_terminal (TTY * t)
 {
-ANSI *ret;
+  ANSI *ret;
 
-ret=malloc(sizeof(ANSI));
-memset(ret,0,sizeof(ANSI));
+  ret = malloc (sizeof (ANSI));
+  memset (ret, 0, sizeof (ANSI));
 
-ret->terminal=t;
+  ret->terminal = t;
 
-ret->update=ansi_update;
-ret->reset=ansi_reset;
-ret->terminal_reset=ansi_terminal_reset;
-ret->close=ansi_free;
+  ret->update = ansi_update;
+  ret->reset = ansi_reset;
+  ret->terminal_reset = ansi_terminal_reset;
+  ret->close = ansi_free;
+  ret->dispatch = ansi_dispatch;
 
+  return ret;
 }