]> git.sur5r.net Git - cc65/blobdiff - include/tgi.h
Merge pull request #3 from greg-king5/ctype
[cc65] / include / tgi.h
index ca5a5dc5fbf120ebe69c8045d524ed55fb2bcbaf..661403370809059966f0af1b492c7c6891aca8fe 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2002-2009, Ullrich von Bassewitz                                      */
+/* (C) 2002-2013, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -38,9 +38,6 @@
 
 
 
-#ifndef _TGI_MODE_H
-#include <tgi/tgi-mode.h>
-#endif
 #ifndef _TGI_ERROR_H
 #include <tgi/tgi-error.h>
 #endif
 
 
 
-/* Color constants */
-#define TGI_COLOR_BLACK         0
-#define TGI_COLOR_WHITE         1
-
-/* Font constants for use with tgi_textstyle */
+/* Font constants for use with tgi_settextstyle */
 #define TGI_FONT_BITMAP         0
 #define TGI_FONT_VECTOR         1
 
-/* Direction constants for use with tgi_textstyle */
+/* Direction constants for use with tgi_settextstyle */
 #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;
+/* The address of the static standard tgi driver for a platform */
+extern const void tgi_static_stddrv[];
 
 /* A vector font definition */
 typedef struct tgi_vectorfont tgi_vectorfont;
@@ -82,19 +75,10 @@ typedef struct tgi_vectorfont tgi_vectorfont;
 
 
 
-void __fastcall__ tgi_load (unsigned char mode);
-/* Load and install the matching driver for the given mode. Will just load
- * the driver and check if loading was successul. Will not switch to gaphics
- * 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.
- */
+/* Load and install the given driver. */
 
-void __fastcall__ tgi_unload (void);
+void tgi_unload (void);
 /* Uninstall, then unload the currently loaded driver. Will call tgi_done if
  * necessary.
  */
@@ -102,15 +86,15 @@ void __fastcall__ tgi_unload (void);
 void __fastcall__ tgi_install (void* driver);
 /* Install an already loaded driver. */
 
-void __fastcall__ tgi_uninstall (void);
+void tgi_uninstall (void);
 /* Uninstall the currently loaded driver but do not unload it. Will call
  * tgi_done if necessary.
  */
 
-void __fastcall__ tgi_init (void);
+void tgi_init (void);
 /* Initialize the already loaded graphics driver. */
 
-void __fastcall__ tgi_done (void);
+void tgi_done (void);
 /* End graphics mode, switch back to text mode. Will NOT uninstall or unload
  * the driver!
  */
@@ -127,10 +111,10 @@ void __fastcall__ tgi_install_vectorfont (const tgi_vectorfont* font);
  * with a NULL pointer to uninstall the currently installed font.
  */
 
-void tgi_free_vectorfont (const tgi_vectorfont* font);
+void __fastcall__ tgi_free_vectorfont (const tgi_vectorfont* font);
 /* Free a vector font that was previously loaded into memory. */
 
-unsigned char __fastcall__ tgi_geterror (void);
+unsigned char tgi_geterror (void);
 /* Return the error code for the last operation. This will also clear the
  * error.
  */
@@ -138,10 +122,10 @@ unsigned char __fastcall__ tgi_geterror (void);
 const char* __fastcall__ tgi_geterrormsg (unsigned char code);
 /* Get an error message describing the error in code. */
 
-void __fastcall__ tgi_clear (void);
+void tgi_clear (void);
 /* Clear the drawpage. */
 
-unsigned __fastcall__ tgi_getpagecount (void);
+unsigned tgi_getpagecount (void);
 /* Returns the number of screen pages available. */
 
 void __fastcall__ tgi_setviewpage (unsigned char page);
@@ -150,10 +134,10 @@ void __fastcall__ tgi_setviewpage (unsigned char page);
 void __fastcall__ tgi_setdrawpage (unsigned char page);
 /* Set the drawable page. Will set an error if the page is not available. */
 
-unsigned char __fastcall__ tgi_getcolorcount (void);
+unsigned char tgi_getcolorcount (void);
 /* Get the number of available colors. */
 
-unsigned char __fastcall__ tgi_getmaxcolor (void);
+unsigned char tgi_getmaxcolor (void);
 /* Return the maximum supported color number (the number of colors would
  * then be getmaxcolor()+1).
  */
@@ -161,7 +145,7 @@ unsigned char __fastcall__ tgi_getmaxcolor (void);
 void __fastcall__ tgi_setcolor (unsigned char color);
 /* Set the current drawing color. */
 
-unsigned char __fastcall__ tgi_getcolor (void);
+unsigned char tgi_getcolor (void);
 /* Return the current drawing color. */
 
 void __fastcall__ tgi_setpalette (const unsigned char* palette);
@@ -169,28 +153,38 @@ void __fastcall__ tgi_setpalette (const unsigned char* palette);
  * a pointer to as many entries as there are colors.
  */
 
-const unsigned char* __fastcall__ tgi_getpalette (void);
+const unsigned char* tgi_getpalette (void);
 /* Return the current palette. */
 
-const unsigned char* __fastcall__ tgi_getdefpalette (void);
+const unsigned char* tgi_getdefpalette (void);
 /* Return the default palette. */
 
-unsigned __fastcall__ tgi_getxres (void);
+unsigned tgi_getxres (void);
 /* Return the resolution in X direction. */
 
-unsigned __fastcall__ tgi_getmaxx (void);
+unsigned tgi_getmaxx (void);
 /* Return the maximum x coordinate. The resolution in x direction is
  * getmaxx() + 1
  */
 
-unsigned __fastcall__ tgi_getyres (void);
+unsigned tgi_getyres (void);
 /* Return the resolution in Y direction. */
 
-unsigned __fastcall__ tgi_getmaxy (void);
+unsigned tgi_getmaxy (void);
 /* Return the maximum y coordinate. The resolution in y direction is
  * getmaxy() + 1
  */
 
+unsigned tgi_getaspectratio (void);
+/* Returns the aspect ratio for the loaded driver. The aspect ratio is an
+ * 8.8 fixed point value.
+ */
+
+void __fastcall__ tgi_setaspectratio (unsigned aspectratio);
+/* Set a new aspect ratio for the loaded driver. The aspect ratio is an
+ * 8.8 fixed point value.
+ */
+
 unsigned char __fastcall__ tgi_getpixel (int x, int y);
 /* Get the color value of a pixel. */
 
@@ -218,28 +212,49 @@ void __fastcall__ tgi_ellipse (int x, int y, unsigned char rx, unsigned char ry)
  * 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_textscale (unsigned width, unsigned height);
+void __fastcall__ tgi_settextdir (unsigned char dir);
+/* Set the direction for text output. dir is one of the TGI_TEXT_XXX
+ * constants.
+ */
+
+void __fastcall__ tgi_settextscale (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);
+void __fastcall__ tgi_settextstyle (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);
+unsigned __fastcall__ tgi_gettextwidth (const char* s);
 /* Calculate the width of the text in pixels according to the current text
  * style.
  */
 
-unsigned __fastcall__ tgi_textheight (const char* s);
+unsigned __fastcall__ tgi_gettextheight (const char* s);
 /* Calculate the height of the text in pixels according to the current text
  * style.
  */
@@ -254,7 +269,7 @@ 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);
+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.