Update to current coding conventions.
[bertos.git] / mware / text.c
index e20c777f5d1a4b58da79961f5c0795ed7f9bde43..d7d0d3b5ce5894aa4ba9d07b007f7fd8cb524222 100755 (executable)
@@ -1,23 +1,28 @@
 /*!
  * \file
  * <!--
+ * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
  * Copyright 1999 Bernardo Innocenti <bernie@develer.com>
- * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
  * This file is part of DevLib - See devlib/README for information.
  * -->
  *
- * \version $Id$
+ * \brief Text graphic routines
  *
+ * \version $Id$
  * \author Bernardo Innocenti <bernie@develer.com>
  * \author Stefano Fedrigo <aleph@develer.com>
- *
- * \brief Text graphic routines
  */
 
 /*#*
  *#* $Log$
- *#* Revision 1.3  2004/08/25 14:12:09  rasky
- *#* Aggiornato il comment block dei log RCS
+ *#* Revision 1.7  2004/09/20 03:28:28  bernie
+ *#* Fix header.
+ *#*
+ *#* Revision 1.6  2004/09/14 20:57:15  bernie
+ *#* Use debug.h instead of kdebug.h.
+ *#*
+ *#* Revision 1.5  2004/09/06 21:51:26  bernie
+ *#* Extend interface to allow any algorithmic style.
  *#*
  *#* Revision 1.2  2004/06/03 11:27:09  bernie
  *#* Add dual-license information.
 #include "gfx.h"
 #include "font.h"
 #include "text.h"
-#include <drv/kdebug.h>
+#include <debug.h>
 
 /*!
  * Flags degli stili algoritmici
+ *
  * La routine di rendering del testo e' in grado di applicare
  * delle semplici trasformazioni al font interno per generare
  * automaticamente degli stili predefiniti (bold, italic,
@@ -92,7 +98,7 @@ void text_setcoord(struct Bitmap *bm, int x, int y)
 
 
 /*!
- * Render char <code>c</code>
+ * Render char \a c on Bitmap \a bm
  */
 static int text_putglyph(char c, struct Bitmap *bm)
 {
@@ -194,14 +200,14 @@ int text_putchar(char c, struct Bitmap *bm)
        {
                switch (c)
                {
-                       case ANSI_ESC_CLEARSCREEN:
-                               gfx_ClearBitmap(bm);
-                               bm->penX = 0;
-                               bm->penY = 0;
-                               text_style(0, STYLEF_MASK);
-                               break;
-                       DB(default:
-                               kprintf("Unknown ANSI esc code: %x\n", c);)
+               case ANSI_ESC_CLEARSCREEN:
+                       gfx_ClearBitmap(bm);
+                       bm->penX = 0;
+                       bm->penY = 0;
+                       text_style(0, STYLEF_MASK);
+                       break;
+               DB(default:
+                       kprintf("Unknown ANSI esc code: %x\n", c);)
                }
                ansi_mode = false;
        }
@@ -235,6 +241,12 @@ void text_clear(struct Bitmap *bmp)
 }
 
 
+void text_clearLine(struct Bitmap *bmp, int line)
+{
+       gfx_ClearRect(bmp, 0, line * FONT_HEIGHT, bmp->width, (line + 1) * FONT_HEIGHT);
+}
+
+
 /*!
  * Set/clear algorithmic font style bits.
  *