]> git.sur5r.net Git - cc65/blobdiff - include/tgi.h
- Adjusted TEXTSTYLE and OUTTEXT to TGI specs
[cc65] / include / tgi.h
index e8580aaf71de68d254a8652dfd323be2c13a4d92..2999c1ad0d0bcac0799b6f5708076cc9397baaab 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2002-2003 Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2002-2009, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 
-/* 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 name of the standard tgi driver for a platform */
+extern const char tgi_stddrv[];
+
+/* The default tgi mode for a platform */
+extern const unsigned char tgi_stdmode;
+
+/* A vector font definition */
+typedef struct tgi_vectorfont tgi_vectorfont;
+
 
 
 /*****************************************************************************/
@@ -74,8 +91,7 @@ void __fastcall__ tgi_load (unsigned char mode);
 void __fastcall__ tgi_load_driver (const char* name);
 /* Load and install the given driver. This function is identical to tgi_load
  * with the only difference that the name of the driver is specified
- * explicitly. You should NOT use this function in most cases, use tgi_load()
- * instead.
+ * explicitly.
  */
 
 void __fastcall__ tgi_unload (void);
@@ -99,15 +115,33 @@ void __fastcall__ tgi_done (void);
  * 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.
  */
 
+const char* __fastcall__ tgi_geterrormsg (unsigned char code);
+/* Get an error message describing the error in code. */
+
 void __fastcall__ tgi_clear (void);
-/* Clear the screen. */
+/* Clear the drawpage. */
 
-void __fastcall__ tgi_getpagecount (void);
+unsigned __fastcall__ tgi_getpagecount (void);
 /* Returns the number of screen pages available. */
 
 void __fastcall__ tgi_setviewpage (unsigned char page);
@@ -182,9 +216,11 @@ void __fastcall__ tgi_circle (int x, int y, unsigned char radius);
 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,
+void __fastcall__ tgi_textstyle (unsigned magwidth, unsigned magheight,
                                  unsigned char dir);
-/* Set the style for text output. */
+/* 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.
+ */
 
 unsigned __fastcall__ tgi_textwidth (const char* s);
 /* Calculate the width of the text in pixels according to the current text
@@ -206,6 +242,12 @@ void __fastcall__ tgi_outtextxy (int x, int y, const char* s);
  * the end of the text.
  */
 
+unsigned __fastcall__ tgi_ioctl (unsigned char code, unsigned val);
+/* 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.
+ */
+
 
 
 /* End of tgi.h */