-/* Constants used for tgi_textstyle */
+/* Color constants */
+#define TGI_COLOR_BLACK 0
+#define TGI_COLOR_WHITE 1
+
+/* Font constants for use with tgi_textstyle */
+#define TGI_FONT_BITMAP 0
+#define TGI_FONT_VECTOR 1
+
+/* Direction constants for use with tgi_textstyle */
#define TGI_TEXT_HORIZONTAL 0
#define TGI_TEXT_VERTICAL 1
/* The default tgi mode for a platform */
extern const unsigned char tgi_stdmode;
+/* A vector font definition */
+typedef struct tgi_vectorfont tgi_vectorfont;
+
/*****************************************************************************/
* the driver!
*/
+const tgi_vectorfont* __fastcall__ tgi_load_vectorfont (const char* name);
+/* Load a vector font into memory and return it. In case of errors, NULL is
+ * returned and an error is set, which can be retrieved using tgi_geterror.
+ * To use the font, it has to be installed using tgi_install_vectorfont.
+ */
+
+void __fastcall__ tgi_install_vectorfont (const tgi_vectorfont* font);
+/* Install a vector font for use. More than one vector font can be loaded,
+ * but only one can be active. This function is used to tell which one. Call
+ * with a NULL pointer to uninstall the currently installed font.
+ */
+
+void tgi_free_vectorfont (const tgi_vectorfont* font);
+/* Free a vector font that was previously loaded into memory. */
+
unsigned char __fastcall__ tgi_geterror (void);
/* Return the error code for the last operation. This will also clear the
* error.
void __fastcall__ tgi_circle (int x, int y, unsigned char radius);
/* Draw a circle in the current drawing color. */
+void __fastcall__ tgi_ellipse (int x, int y, unsigned char rx, unsigned char ry);
+/* Draw a full ellipse with center at x/y and radii rx/ry using the current
+ * drawing color.
+ */
+
+void __fastcall__ tgi_arc (int x, int y, unsigned char rx, unsigned char ry,
+ unsigned sa, unsigned ea);
+/* Draw an ellipse arc with center at x/y and radii rx/ry using the current
+ * drawing color. The arc covers the angle between sa and ea (startangle and
+ * endangle), which must be in the range 0..360 (otherwise the function may
+ * bevave unextectedly).
+ */
+
+void __fastcall__ tgi_pieslice (int x, int y, unsigned char rx, unsigned char ry,
+ unsigned sa, unsigned ea);
+/* Draw an ellipse pie slice with center at x/y and radii rx/ry using the
+ * current drawing color. The pie slice covers the angle between sa and ea
+ * (startangle and endangle), which must be in the range 0..360 (otherwise the
+ * function may behave unextectedly).
+ */
+
void __fastcall__ tgi_bar (int x1, int y1, int x2, int y2);
/* Draw a bar (a filled rectangle) using the current color. */
-void __fastcall__ tgi_textstyle (unsigned char magx, unsigned char magy,
- unsigned char dir);
-/* Set the style for text output. */
+void __fastcall__ tgi_textscale (unsigned width, unsigned height);
+/* Set the scaling for text output. The scaling factors for width and height
+ * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
+ */
+
+void __fastcall__ tgi_textstyle (unsigned width, unsigned height,
+ unsigned char dir, unsigned char font);
+/* Set the style for text output. The scaling factors for width and height
+ * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
+ * dir is one of the TGI_TEXT_XXX constants. font is one of the TGI_FONT_XXX
+ * constants.
+ */
unsigned __fastcall__ tgi_textwidth (const char* s);
/* Calculate the width of the text in pixels according to the current text
* the end of the text.
*/
-unsigned __fastcall__ tgi_ioctl (unsigned char code, unsigned val);
+unsigned __fastcall__ tgi_ioctl (unsigned char code, void* data);
/* Call the driver specific control function. What this function does for
* a specific code depends on the driver. The driver will set an error
* for unknown codes or values.