Sistema l'errore da me commesso in fase di conversione...
[bertos.git] / gfx / text.h
old mode 100755 (executable)
new mode 100644 (file)
index d131e01..9d1fd4d
@@ -1,4 +1,4 @@
-/*!
+/**
  * \file
  * <!--
  * Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
 
 /*#*
  *#* $Log$
+ *#* Revision 1.8  2006/09/13 13:58:55  bernie
+ *#* text_moveTo(): Swap parameters.
+ *#*
+ *#* Revision 1.7  2006/07/19 12:56:26  bernie
+ *#* Convert to new Doxygen style.
+ *#*
+ *#* Revision 1.6  2006/04/27 05:39:24  bernie
+ *#* Enhance text rendering to arbitrary x,y coords.
+ *#*
+ *#* Revision 1.5  2006/04/11 00:08:24  bernie
+ *#* text_offset(): New function, but I'm not quite confident with the design.
+ *#*
+ *#* Revision 1.4  2006/03/07 22:18:04  bernie
+ *#* Correctly compute text width for prop fonts; Make styles a per-bitmap attribute.
+ *#*
+ *#* Revision 1.3  2006/02/10 12:26:19  bernie
+ *#* Add STYLEF_TALL (unimplemented).
+ *#*
+ *#* Revision 1.2  2005/11/04 18:17:45  bernie
+ *#* Fix header guards and includes for new location of gfx module.
+ *#*
  *#* Revision 1.1  2005/11/04 18:11:35  bernie
  *#* Move graphics stuff from mware/ to gfx/.
  *#*
  *#*
  *#*/
 
-#ifndef MWARE_TEXT_H
-#define MWARE_TEXT_H
+#ifndef GFX_TEXT_H
+#define GFX_TEXT_H
 
 #include <cfg/compiler.h>
 #include <cfg/macros.h> /* BV() */
 #include <cfg/cpu.h> /* CPU_HARVARD */
+#include <gfx/gfx.h> /* coord_t */
 
 #include <stdarg.h>
 
-/*!
+/**
  * \name Style flags
  * \see text_style()
  * \{
 #define STYLEF_EXPANDED    BV(4)
 #define STYLEF_CONDENSED   BV(5)
 #define STYLEF_STRIKEOUT   BV(6)  /*<! Not implemented */
+#define STYLEF_TALL        BV(7)  /*<! Not implemented */
 
 #define STYLEF_MASK \
-       (STYLEF_BOLD | STYLEF_ITALIC | STYLEF_UNDERLINE | \
-       STYLEF_EXPANDED | STYLEF_CONDENSED | STYLEF_INVERT)
+       (STYLEF_BOLD | STYLEF_ITALIC | STYLEF_UNDERLINE \
+       | STYLEF_INVERT | STYLEF_EXPANDED | STYLEF_CONDENSED \
+       | STYLEF_STRIKEOUT | STYLEF_TALL)
 /*\}*/
 
-/*!
+/**
  * \name Formatting flags for text rendering
  * \see text_xprintf()
  * \{
  */
-#define TEXT_NORMAL   0       /*!< Normal mode */
-#define TEXT_FILL     BV(7)   /*!< Fill rest of line with spaces */
-#define TEXT_CENTER   BV(8)   /*!< Center string in line */
-#define TEXT_RIGHT    BV(9)   /*!< Right aligned */
+#define TEXT_NORMAL   0       /**< Normal mode */
+#define TEXT_FILL     BV(13)  /**< Fill rest of line with spaces */
+#define TEXT_CENTER   BV(14)  /**< Center string in line */
+#define TEXT_RIGHT    BV(15)  /**< Right aligned */
 /*\}*/
 
-/*! Escape sequences codes */
+/** Escape sequences codes */
 #define ANSI_ESC_CLEARSCREEN 'c'
 
 
 struct Bitmap;
 
 /* Low-level text functions (mware/text.c) */
-void text_moveto(struct Bitmap *bm, int row, int col);
-void text_setcoord(struct Bitmap *bm, int x, int y);
+void text_moveTo(struct Bitmap *bm, int row, int col);
+void text_setCoord(struct Bitmap *bm, int x, int y);
 int text_putchar(char c, struct Bitmap *bm);
-uint8_t text_style(uint8_t flags, uint8_t mask);
+uint8_t text_style(struct Bitmap *bm, uint8_t flags, uint8_t mask);
 void text_clear(struct Bitmap *bm);
 void text_clearLine(struct Bitmap *bm, int line);
 
@@ -107,6 +131,8 @@ void text_clearLine(struct Bitmap *bm, int line);
 int text_puts(const char *str, struct Bitmap *bm);
 int text_vprintf(struct Bitmap *bm, const char *fmt, va_list ap);
 int text_printf(struct Bitmap *bm, const char *fmt, ...) FORMAT(__printf__, 2, 3);
+int text_xyvprintf(struct Bitmap *bm, coord_t x, coord_t y, uint16_t mode, const char *fmt, va_list ap);
+int text_xyprintf(struct Bitmap *bm, coord_t x, coord_t col, uint16_t mode, const char *fmt, ...) FORMAT(__printf__, 5, 6);
 int text_xprintf(struct Bitmap *bm, uint8_t row, uint8_t col, uint16_t mode, const char *fmt, ...) FORMAT(__printf__, 5, 6);
 int text_vwidthf(struct Bitmap *bm, const char * fmt, va_list ap);
 int text_widthf(struct Bitmap *bm, const char * fmt, ...) FORMAT(__printf__, 2, 3);
@@ -122,4 +148,4 @@ int text_vwidthf_P(struct Bitmap *bm, const char * PROGMEM fmt, va_list ap);
 int text_widthf_P(struct Bitmap *bm, const char * PROGMEM fmt, ...);
 #endif /* CPU_HARVARD */
 
-#endif /* MWARE_TEXT_H */
+#endif /* GFX_TEXT_H */